#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int n, q, zero, maxv;
int a[maxn], lx[maxn], rx[maxn], vis[maxn];
int t[1 << 19];
inline void push_up(int rt) { t[rt] = min(t[rt << 1], t[rt << 1 | 1]); }
void build(int rt, int l, int r) {
  if (l == r) {
    cin >> t[rt];
    a[l] = t[rt];
    if (lx[t[rt]] == 0) lx[t[rt]] = l;
    rx[t[rt]] = l;
    if (t[rt] == 0) zero++, t[rt] = inf;
    if (t[rt] == q) maxv++;
    return;
  }
  int m = (l + r) >> 1;
  build(rt << 1, l, m);
  build(rt << 1 | 1, m + 1, r);
  push_up(rt);
}
int query(int rt, int l, int r, int L, int R) {
  if (L <= l && r <= R) return t[rt];
  int m = (l + r) >> 1;
  int res = inf;
  if (L <= m) res = min(res, query(rt << 1, l, m, L, R));
  if (m < R) res = min(res, query(rt << 1 | 1, m + 1, r, L, R));
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> q;
  build(1, 1, n);
  if (zero == 0 && maxv == 0) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0 && maxv == 0)
      maxv++, a[i] = q;
    else if (a[i] == 0)
      a[i] = max(1, max(a[i - 1], a[i + 1]));
    else if (!vis[a[i]]) {
      vis[a[i]] = 1;
      if (rx[a[i]] - lx[a[i]] >= 2) {
        int tmp = query(1, 1, n, lx[a[i]] + 1, rx[a[i]] - 1);
        if (tmp < a[i]) {
          cout << "NO" << endl;
          return 0;
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
