N=int(input()) a=list(map(int,input().split())) a=[(i+1,j) for i,j in enumerate(a)] a.sort(key=lambda x:x[1]) ans=[] for j,i in enumerate(a): if i[1]>j+1: print("NO") exit() else: ans.append((i[0],j+2-i[1])) ans.sort() print("YES") for i,j in ans: print(j)