import bisect def main(): import sys input = sys.stdin.read data = input().split() n = int(data[0]) a = list(map(int, data[1:n])) reachable = [1] current_max = 1 target = 2 x_list = [] for ai in a: if target > n: break x_candidate = target - ai if x_candidate >= 1: idx = bisect.bisect_left(reachable, x_candidate) if idx < len(reachable) and reachable[idx] == x_candidate: x = x_candidate y = x + ai x_list.append(x) if y > current_max: current_max = y if y not in reachable: bisect.insort(reachable, y) while target <= n: idx_target = bisect.bisect_left(reachable, target) if idx_target < len(reachable) and reachable[idx_target] == target: target += 1 else: break continue x_max = min(current_max, n - ai) if x_max < 1: print("NO") return idx = bisect.bisect_right(reachable, x_max) - 1 if idx < 0: print("NO") return x = reachable[idx] y = x + ai x_list.append(x) if y > current_max: current_max = y if y not in reachable: bisect.insort(reachable, y) if y >= target: while target <= n: idx_target = bisect.bisect_left(reachable, target) if idx_target < len(reachable) and reachable[idx_target] == target: target += 1 else: break if target > n: print("YES") for x in x_list: print(x) else: print("NO") if __name__ == "__main__": main()