n = int(input()) n -= 1 a = list(map(int, input().split())) for i in range(n): a[i] = [a[i], i, 0] a.sort() for i in range(n): if a[i][0] > i + 1: print('NO') break else: print('YES') for i in range(n): a[i][2] = i + 2 - a[i][0] a.sort(key=lambda x:x[1]) for row in a: print(row[2])