2

h2022027 2023-10-04 20:00:34

#include <bits/stdc++.h> using namespace std; int a[1010]; int main() { int s = 0, n; cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 1; i < n - 1; ++i) { if (a[i] > a[i - 1] && a[i] > a[i + 1]) { s = s + 1; } } if(s==n){ cout<<"yes"<<endl; }else{ cout<<"no"<<endl; } return 0; }