import sys input = sys.stdin.readline from collections import * N = int(input()) a = list(map(int, input().split())) b = a[:] b.sort() ans = defaultdict(list) now = 1 for bi in b: if now-bi>=0: ans[bi].append(now-bi) now += 1 else: print('NO') exit() print('YES') for ai in a: print(ans[ai].pop()+1)