n = int(input()) a = list(map(int,input().split())) if min(a) <= 1 and all(abs(a[i]-a[i+1]) <= 1 for i in range(n-1)): print('Yes') else: print('No')