Source Code



while True:
    x = int(input())
    if x >=1 and x <=10**5:
        break
list = []

list=(input())
list= list.split(" ")



flag = True
for i in range(len(list)-1):
    if int(list [i]) > int(list[i+1]):
        flag = False
        break


if flag:
    print("YES")
else:
    print("NO")                    
Copy
Anton Can't See (⊙︿⊙)_/¯ massoud01
Python 3
99 ms
11.6 MB
Accepted