import sys sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] # inf = 18446744073709551615 inf = 4294967295 md = 10**9+7 # md = 998244353 def ok(p): to = [[] for _ in range(m)] indeg = [0]*m for i in range(n-1): u, v = aa[i], aa[i+1] if i & 1 == p: u, v = v, u to[u].append(v) indeg[v] += 1 st = [u for u in range(m) if indeg[u] == 0] uu = [] while st: u = st.pop() uu.append(u) for v in to[u]: indeg[v] -= 1 if indeg[v] == 0: st.append(v) if len(uu) < m: return [] return uu n, m = LI() aa = LI1() for a0, a1 in zip(aa, aa[1:]): if a0 == a1: print("No") exit() for a0, a1 in zip(aa, aa[2:]): if a0 == a1: print("No") exit() uu = ok(0) if not uu: ans = ok(1) if uu: ans = [0]*m for i, u in enumerate(uu, 1): ans[u] = i print("Yes") print(*ans) else: print("No")