N = int(input()) A = list(map(int, input().split())) while A != [0] * N: for i in range(N): if A[i] == i + 1: A[i] = 0 for j in range(i): A[j] += 1 break else: print('No') exit() print('Yes')