import heapq def main(): N = int(input()) A = list(map(int, input().split())) B = [(a, i) for i, a in enumerate(A)] B.sort(reverse=True) ans = [-1] * (N - 1) for to in range(1, N): a, i = B.pop() if a > to: print("NO") return ans[i] = to - a + 1 print("YES") print(*ans, sep="\n") main()