class Topological_Sort: def __init__(self,N): self.N=N self.arc=[[] for _ in range(N)] self.rev=[[] for _ in range(N)] def add_arc(self,source,target): self.arc[source].append(target) self.rev[target].append(source) def sort(self): in_deg=[len(self.rev[x]) for x in range(self.N)] Q=[x for x in range(self.N) if in_deg[x]==0] S=[] while Q: u=Q.pop() S.append(u) for v in self.arc[u]: in_deg[v]-=1 if in_deg[v]==0: Q.append(v) return S def is_DAG(self): return len(self.sort())==self.N #================================================ N,M=map(int,input().split()) A=list(map(int,input().split())) for i in range(N-1): if A[i]==A[i+1]: print("No") exit() for i in range(N-2): if A[i]==A[i+2]: print("No") exit() Mode=0 T=Topological_Sort(M+1) for i in range(N-1): if Mode: T.add_arc(A[i],A[i+1]) else: T.add_arc(A[i+1],A[i]) Mode^=1 S=T.sort() if len(S)==M+1: print("Yes") X=[0]*(M+1) for i,v in enumerate(S,1): X[v]=i print(" ".join(map(str,X[1:]))) else: print("No")