#1370 import sys;input = lambda: sys.stdin.readline().rstrip() #import numpy as np #import heapq from collections import deque def topological_sort(In, Out): """ In: 入力してくる頂点集合 Out: 出力先の頂点集合 """ dq = deque() L = [] for i, I in enumerate(In): if not I: dq.append(i) while dq: v = dq.popleft() L.append(v) for w in Out[v]: In[w].remove(v) if not In[w]: dq.append(w) if len(L) < len(In): return False return L # = input() # = int(input()) n, m = map(int,input().split()) A = list(map(lambda x: int(x)-1,input().split())) for i in range(N-2): if len(set(A[i:i+3])) != 3: print('No') exit() In, Out = [set() for _ in range(m)], [set() for _ in range(m)] for i in range(n-1): if i&1: In[A[i]].add(A[i+1]) Out[A[i+1]].add(A[i]) else: In[A[i+1]].add(A[i]) Out[A[i]].add(A[i+1]) ts = topological_sort(In, Out) if not ts: print('No') else: print('Yes') X = [None]*m for i in range(m): X[ts[i]] = i+1 print(*X, sep = ' ')