def main(): import sys input = sys.stdin.read().split() idx = 0 N = int(input[idx]) idx += 1 a_list = list(map(int, input[idx:idx + N-1])) reachable = {1} x_choices = [] for a in a_list: max_x = N - a if max_x < 1: print("NO") return sorted_reachable = sorted(reachable) found = False for x in sorted_reachable: if x > max_x: break new_node = x + a if new_node not in reachable: x_choices.append(x) reachable.add(new_node) found = True break if not found: if sorted_reachable[0] > max_x: print("NO") return x = sorted_reachable[0] new_node = x + a x_choices.append(x) if new_node not in reachable: reachable.add(new_node) if len(reachable) != N: print("NO") else: print("YES") for x in x_choices: print(x) if __name__ == "__main__": main()