n = int(input()) a = [(int(x), i) for i, x in enumerate(input().split())] a.sort() ans = [0] * (n - 1) for i, (aj, j) in enumerate(a, 1): if i - aj < 0: print('NO') exit() ans[j] = i - aj + 1 print('YES') print(*ans, sep='\n')