#include int ri() { int n; scanf("%d", &n); return n; } std::vector > hen; std::vector ord; std::vector visited; int cnt; void dfs(int i) { visited[i] = true; for (auto j : hen[i]) { if (visited[j]) continue; dfs(j); } ord[i] = --cnt; } int main() { int n = ri(); int m = ri(); int a[n]; for (int i = 0; i < n; i++) a[i] = ri() - 1; hen.resize(m); for (int i = 0; i + 1 < n; i++) { if (i & 1) hen[a[i]].push_back(a[i + 1]); else hen[a[i + 1]].push_back(a[i]); } ord.resize(m, -1); visited.resize(m, false); cnt = m; for (int i = 0; i < m; i++) if (!visited[i]) dfs(i); bool res = true; for (int i = 0; i < m; i++) { for (auto j : hen[i]) if (ord[j] <= ord[i]) { res = false; break; } if (!res) break; } if (!res) puts("No"); else { puts("Yes"); for (int i = 0; i < m; i++) { if (i) printf(" "); printf("%d", ord[i] + 1); } puts(""); } return 0; }