import sys def main(): sys.setrecursionlimit(1 << 25) N = int(sys.stdin.readline()) a_list = list(map(int, sys.stdin.readline().split())) if len(a_list) != N-1: print("NO") return reachable = {1} sorted_reachable = [1] x_choices = [] for a in a_list: found = False for x in sorted_reachable: y = x + a if y > N: continue if y not in reachable: reachable.add(y) x_choices.append(x) # Insert y into sorted_reachable to keep it sorted left, right = 0, len(sorted_reachable) while left < right: mid = (left + right) // 2 if sorted_reachable[mid] < y: left = mid + 1 else: right = mid sorted_reachable.insert(left, y) found = True break if not found: print("NO") return if len(reachable) == N: print("YES") for x in x_choices: print(x) else: print("NO") if __name__ == "__main__": main()