### BUGGY CODE ###

N = int(input())
h_list = list(map(int, input().split()))
# print(N, h_list)

flag = True
for i in range(0, N-1):
    for j in range(i+1, N):
        if (h_list[i]- h_list[j]) > 1:
            flag = False

if flag:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N = int(input())                                                                                                                                                                                                                                                                
h_list = list(map(int, input().split()))                                                                                                                                                                                                                                        
# print(N, h_list)                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                
flag = True                                                                                                                                                                                                                                                                     
for i in reversed(range(1, N)):                                                                                                                                                                                                                                                 
    diff = h_list[i-1]- h_list[i]                                                                                                                                                                                                                                               
#    print(i, diff)                                                                                                                                                                                                                                                             
    if diff >= 2:                                                                                                                                                                                                                                                               
        flag = False                                                                                                                                                                                                                                                            
        break                                                                                                                                                                                                                                                                   
    elif diff == 1:                                                                                                                                                                                                                                                             
        h_list[i-1] -= 1                                                                                                                                                                                                                                                        
    else:                                                                                                                                                                                                                                                                       
        pass                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                
if flag:                                                                                                                                                                                                                                                                        
    print("Yes")                                                                                                                                                                                                                                                                
else:                                                                                                                                                                                                                                                                           
    print("No")