Source Code
def solve(arr,x):
    for i in (0,x-2):
        if(arr[i+1]<arr[i]):
            return "NO"
            break
    
    return "YES"


T = int(input())

arr = [int(x) for x in input().split()]

print(solve(arr,T))
    
Copy
Anton Can't See (⊙︿⊙)_/¯ misterRoshi22
Python 3
37 ms
14.9 MB
Runtime Error