from heapq import heappop, heappush N, *A = map(int, open(0).read().split()) q = [] for i in range(N): if A[i] == i + 1: heappush(q, i) while q: i = heappop(q) A[i] = 0 for j in range(i): A[j] += 1 if A[j] == j + 1: heappush(q, j) if all(a == 0 for a in A): print('Yes') else: print('No')