Source Code
#include <iostream>
using namespace std;
const int N = 1e5 + 5;
int main() {
	int a[N], num;

	scanf("%d", &num);

	for (int i = 0; i < num; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < num-1; i++) {
		
		if (a[i] > a[i+1]) {
			printf("NO");
			return 0;
		}
	}
	printf("YES");
	return 0;
}
Copy
Anton Can't See (⊙︿⊙)_/¯ safareto
GNU G++17
29 ms
1.2 MB
Accepted