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(); static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray(); static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, m) = (c[0], c[1]); var a = NList; var ans = Kado(n, m, a); if (ans[0] == -1) { WriteLine("No"); } else { WriteLine("Yes"); WriteLine(string.Join(" ", ans)); } } static int[] Kado(int n, int m, int[] a) { for (var i = 0; i < n; ++i) for (var j = 1; j < 3; ++j) { if (i + j < n && a[i] == a[i + j]) return new int[] { -1 }; } var tree = new List[m]; for (var i = 0; i < m; ++i) tree[i] = new List(); var refs = new int[m]; for (var i = 0; i + 1 < n; ++i) { if (i % 2 == 0) { tree[a[i] - 1].Add(a[i + 1] - 1); ++refs[a[i + 1] - 1]; } else { tree[a[i + 1] - 1].Add(a[i] - 1); ++refs[a[i] - 1]; } } var q = new Queue(); for (var i = 0; i < m; ++i) if (refs[i] == 0) q.Enqueue(i); var num = 1; var ans = new int[m]; while (q.Count > 0) { var cur = q.Dequeue(); ans[cur] = num; ++num; foreach (var next in tree[cur]) { --refs[next]; if (refs[next] == 0) { q.Enqueue(next); } } } if (ans.Any(ai => ai == 0)) return new int[] { -1 }; return ans; } }