N = int(input()) l = [0]+[int(input()) for _ in range(N)] s = "YES" for i in range(N-1): if abs(l[i+1]-l[i])!=1: s = "NO" print(s)