N = int(input()) A = list(map(int,input().split())) A = sorted([(A[i],i) for i in range(N-1)],key=lambda x:x[0]) V = [0]*(N+1) V[1] = 1 ans = [0]*(N-1) cur = 1 flag = "YES" for i in range(N-1): a,j = A[i] if V[cur+1-a]==1: ans[j] = cur+1-a V[cur+1] = 1 cur += 1 else: flag = "NO" break print(flag) if flag=="YES": for i in range(N-1): print(ans[i])