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
GNU G++17
0 ms
0 KB
Compilation Error