using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var a = NList; var list = a.Select((ai, id) => (ai, id)).ToList(); list.Sort((l, r) => l.ai.CompareTo(r.ai)); var ans = new int[list.Count]; for (var i = 0; i < list.Count; ++i) { if (i + 1 - list[i].ai < 0) { WriteLine("NO"); return; } ans[list[i].id] = i + 2 - list[i].ai; } WriteLine("YES"); WriteLine(string.Join("\n", ans)); } }