#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
const int INF = 0x3f3f3f3f;
int v[MAXN << 2], lazy[MAXN << 2];
int n, q, L[MAXN], R[MAXN], a[MAXN], b[MAXN], tag, maxq;
int pre[MAXN], nxt[MAXN];
void pushdown(int rt) {
  if (!lazy[rt]) return;
  v[rt << 1] = v[rt << 1 | 1] = v[rt];
  lazy[rt << 1] = lazy[rt << 1 | 1] = 1;
  lazy[rt] = 0;
}
void upd(int l, int r, int val, int st, int en, int rt) {
  if (l <= st && en <= r) {
    v[rt] = val;
    lazy[rt] = 1;
    return;
  }
  int md = (st + en) >> 1;
  pushdown(rt);
  if (l <= md) upd(l, r, val, st, md, rt << 1);
  if (md < r) upd(l, r, val, md + 1, en, rt << 1 | 1);
}
int query(int pos, int st, int en, int rt) {
  if (st == en) return v[rt];
  int md = (st + en) >> 1;
  pushdown(rt);
  if (pos <= md)
    return query(pos, st, md, rt << 1);
  else
    return query(pos, md + 1, en, rt << 1 | 1);
}
int main(void) {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= q; i++) L[i] = n + 1;
  int pos = 1;
  while (a[pos] != 0 && pos != n + 1) pos++;
  for (int i = 1; i <= n; i++) {
    L[a[i]] = min(L[a[i]], i);
    R[a[i]] = max(R[a[i]], i);
    maxq = max(a[i], maxq);
  }
  upd(1, n, 1, 1, n, 1);
  for (int i = 2; i <= q; i++) {
    if (!R[i]) {
      if (pos != n + 1)
        upd(pos, pos, i, 1, n, 1);
      else if (R[maxq])
        upd(R[maxq], R[maxq], i, 1, n, 1);
      else {
        printf("NO");
        return 0;
      }
    } else
      upd(L[i], R[i], i, 1, n, 1);
  }
  for (int i = 1; i <= n; i++) {
    b[i] = query(i, 1, n, 1);
    if (a[i] != b[i] && a[i]) {
      printf("NO");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    printf("%d ", b[i]);
  }
  return 0;
}
