#include using namespace std; int main(){ int N, M; cin >> N >> M; vector a(N); for (int i = 0; i < N; i++){ cin >> a[i]; a[i]--; } bool ok = true; for (int i = 0; i < N - 2; i++){ if (a[i] == a[i + 2]){ ok = false; } } if (!ok){ cout << "No" << endl; } else { vector> E(M); for (int i = 0; i < N - 1; i++){ if (i % 2 == 0){ E[a[i]].push_back(a[i + 1]); } else { E[a[i + 1]].push_back(a[i]); } } vector d(M, 0); for (int i = 0; i < M; i++){ for (int j : E[i]){ d[j]++; } } queue Q; for (int i = 0; i < M; i++){ if (d[i] == 0){ Q.push(i); } } int cnt = 0; vector ans(M, -1); while (!Q.empty()){ int v = Q.front(); Q.pop(); cnt++; ans[v] = cnt; for (int w : E[v]){ d[w]--; if (d[w] == 0){ Q.push(w); } } } for (int i = 0; i < M; i++){ if (ans[i] == -1){ ok = false; } } if (!ok){ cout << "No" << endl; } else { cout << "Yes" << endl; for (int i = 0; i < M; i++){ cout << ans[i] << endl; } } } }