import heapq def main(): import sys input = sys.stdin.read data = input().split() n = int(data[0]) a_list = list(map(int, data[1:n])) connected = set([1]) heap = [1] heapq.heapify(heap) result = [] possible = True for ai in a_list: found = False temp = [] while heap: x = heapq.heappop(heap) new_node = x + ai if new_node > n: temp.append(x) continue if new_node not in connected: connected.add(new_node) heapq.heappush(heap, x) heapq.heappush(heap, new_node) result.append(x) found = True break else: temp.append(x) for x in temp: heapq.heappush(heap, x) if not found: possible = False break if possible and len(connected) == n: print("YES") print('\n'.join(map(str, result))) else: print("NO") if __name__ == "__main__": main()