Source Code
#include <iostream>
using namespace std;


int main() {
	int n;
	cin >> n;
	
	int arr[100000];
	for (int i = 0; i < n; i++) 
		cin >> arr[i];
	for (int i = 1; i < n; i++)
		if (arr[i] < arr[i - 1]) {
			cout << "NO" << endl; return 0;
		}

	cout << "YES" << endl;

	return 0;
}
Copy
Anton Can't See (⊙︿⊙)_/¯ yaman
GNU G++17
46 ms
1.2 MB
Accepted