#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair; const ll INF = (1LL << 61); ll mod = 998244353; signed main() { ios::sync_with_stdio(false); cin.tie(0); int N, M; cin >> N >> M; bool ok = true; vectora(N); for (int i = 0; i < N; i++)cin >> a[i]; for (int i = 0; i < N; i++)a[i]--; for (int i = 0; i < N - 2; i++) { if (a[i] == a[i + 2]) { ok = false; } } vector>G(M); for (int i = 0; i < N - 1; i++) { if (i % 2 == 0) { G[a[i]].push_back(a[i + 1]); } else { G[a[i + 1]].push_back(a[i]); } } vectorind(M); for (int i = 0; i < M; i++) { for (auto j : G[i])ind[j]++; } queueq; for (int i = 0; i < M; i++) { if (ind[i] == 0)q.push(i); } int cnt = 0; vectorans(M, -1); while (!q.empty()) { int now = q.front(); q.pop(); cnt++; ans[now] = cnt; for (auto nv : G[now]) { ind[nv]--; if (ind[nv] == 0)q.push(nv); } } for (int i = 0; i < M; i++) { if (ans[i] == -1)ok = false; } if (ok) { cout << "Yes" << endl; for (int i = 0; i < M; i++) { cout << ans[i]; if (i == M - 1)cout << endl; else cout << " "; } } else { cout << "No" << endl; } return 0; }