import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Idx[] idxes = new Idx[n - 1]; for (int i = 0; i < n - 1; i++) { idxes[i] = new Idx(i, sc.nextInt()); } Arrays.sort(idxes); int[] ans = new int[n - 1]; for (int i = 0; i < n - 1; i++) { if (idxes[i].value > i + 1) { System.out.println("NO"); return; } ans[idxes[i].idx] = i + 2 - idxes[i].value; } StringBuilder sb = new StringBuilder(); sb.append("YES").append("\n"); for (int i = 0; i < n - 1; i++) { sb.append(ans[i]).append("\n"); } System.out.print(sb); } static class Idx implements Comparable { int idx; int value; public Idx(int idx, int value) { this.idx = idx; this.value = value; } public int compareTo(Idx another) { return value - another.value; } } }