N,M = map(int,input().split()) A = list(map(int,input().split())) ALL = [i for i in range(M)] ALL = set(ALL) G = [[] for _ in range(M)] for i in range(N-1): a = A[i] - 1 #0index b = A[i+1] - 1 if a == b: print("No");exit() if i < N-2: c = A[i+2] - 1 if a == c: print("No");exit() if i%2 == 0: G[a].append(b) ALL.discard(b) else: G[b].append(a) ALL.discard(a) #print(G) ALL = list(ALL) used = set([]) TS = [] def dfs(v): if v in used: return used.add(v) for w in G[v]: if w in used: continue dfs(w) TS.append(w) #帰りがけで記録 for root in ALL: #すべての始点について dfs(root) TS.append(root) TS.reverse() #最後に反転 #print(TS) if len(TS) < M: print("No") else: ans = [-1]*M for i, v in enumerate(TS): ans[v] = i + 1 print("Yes") print(*ans)