import sys from collections import deque sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N,M = MI() A = LI() for i in range(N-2): if A[i] == A[i+2] or A[i] == A[i+1] or A[i+1] == A[i+2]: exit(print('No')) Graph = [[] for _ in range(M+1)] in_deg = [0]*(M+1) # 入次数 for i in range(N-1): if i % 2 == 0: Graph[A[i]].append(A[i+1]) in_deg[A[i+1]] += 1 else: Graph[A[i+1]].append(A[i]) in_deg[A[i]] += 1 def Topological_Sort(N,Graph,in_deg): """ Nは頂点数,Graphはグラフの隣接リスト表現,in_degは入次数(1-based) len(t_sort) < N なら有向サイクルが存在し、トポロジカルソート不可能 """ t_sort = [] deq = deque([i for i in range(1,N+1) if in_deg[i] == 0]) while deq: u = deq.pop() t_sort.append(u) for v in Graph[u]: in_deg[v] -= 1 if in_deg[v] == 0: deq.append(v) return t_sort T = Topological_Sort(M,Graph,in_deg) if len(T) == M: print('Yes') ANS = [0]*(M+1) for i in range(1,M+1): ANS[T[i-1]] = i print(*ANS[1:]) else: print('No')