Source Code

n = int(input())
tmp = input()
k = tmp.split(" ")
cond = True

for i in range(0, n - 1):
    if (int(k[i]) > int(k[i+1])):
        print("NO")
        cond = False
if (cond):
    print("YES")
Copy
Anton Can't See (⊙︿⊙)_/¯ SilverCryptor
Python 3
93 ms
11.8 MB
Wrong Answer