문제
풀이
#include <iostream>
#include <vector>
using namespace std;
bool solve(void) {
int n; cin >> n;
vector<int> a(n);
for (int i=0; i<n; i++) cin >> a[i];
for (int i=1; i<n; i++) {
if (a[i] < a[i-1]) return false;
}
return true;
}
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << (solve() ? "yes" : "no");
return 0;
}