import heapq n = int(input()) a = list(map(int, input().split())) reachable = [False] * (n + 1) reachable[1] = True unreachable = list(range(2, n + 1)) heapq.heapify(unreachable) result = [] possible = True for ai in a: temp = [] found = False while unreachable: s = heapq.heappop(unreachable) x = s - ai if x >= 1 and reachable[x]: reachable[s] = True result.append(x) found = True break else: temp.append(s) if not found: possible = False break for node in temp: heapq.heappush(unreachable, node) if possible: print("YES") for x in result: print(x) else: print("NO")