N = int(input()) a = list(map(int,input().split())) b = [(a[i],i) for i in range(N-1)] b=sorted(b) a = sorted(a) d = True z=[] for i in range(N-1): #print(i-a[i]+1) if i-a[i]+1<0: d = False break z.append((b[i][1],i-a[i]+2)) z = sorted(z) if d: print("YES") for i in range(N-1): print(z[i][1]) else: print("NO")