#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int ll, rr, v, lazy[N * 4 + 1], st[N * 4 + 1], n, q, a[N], b[N], pre[N], suf[N],
    mi[N], mx[N];
void pushdown(int ind) {
  if (lazy[ind]) {
    st[ind << 1] = lazy[ind << 1] = lazy[ind];
    st[ind << 1 | 1] = lazy[ind << 1 | 1] = lazy[ind];
    lazy[ind] = 0;
  }
}
void update(int ind, int l, int r) {
  if (ll <= l && r <= rr) {
    lazy[ind] = v;
    st[ind] = v;
    return;
  }
  pushdown(ind);
  int mid = (l + r) >> 1;
  if (ll <= mid) update(ind << 1, l, mid);
  if (mid < rr) update(ind << 1 | 1, mid + 1, r);
}
int ask(int ind, int l, int r) {
  if (l == r) return st[ind];
  pushdown(ind);
  int mid = (l + r) >> 1;
  return ll <= mid ? ask(ind << 1, l, mid) : ask(ind << 1 | 1, mid + 1, r);
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  bool fl = 0;
  for (int i = 1; i <= n; ++i)
    if (a[i]) fl = 1;
  if (!fl) {
    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", q);
    return 0;
  }
  int fl0 = 0;
  for (int i = 1; i <= n; ++i)
    if (!a[i]) fl0 = i;
  pre[1] = 1;
  for (int i = 2; i <= n; ++i)
    if (a[i - 1] == 0)
      pre[i] = pre[i - 1];
    else
      pre[i] = i;
  suf[n] = n;
  for (int i = n - 1; i >= 1; --i)
    if (a[i + 1] == 0)
      suf[i] = suf[i + 1];
    else
      suf[i] = i;
  for (int i = 1; i <= q; ++i) mi[i] = n + 1, mx[i] = 0;
  for (int i = 1; i <= n; ++i) {
    mi[a[i]] = min(mi[a[i]], pre[i]);
    mx[a[i]] = max(mx[a[i]], suf[i]);
  }
  for (int i = 1, j; i <= q; i = j + 1)
    if (mx[i]) {
      ll = mi[i];
      rr = mx[i];
      v = i;
      update(1, 1, n);
      j = i;
    } else if (fl0) {
      ll = fl0;
      rr = fl0;
      v = i;
      update(1, 1, n);
      j = i;
    } else {
      j = i;
      while (!mx[j] && j <= q) ++j;
      if (j == q + 1) return puts("NO"), 0;
      --j;
    }
  for (int i = 1; i <= n; ++i) {
    ll = i;
    b[i] = ask(1, 1, n);
  }
  for (int i = 1; i <= n; ++i)
    if (a[i]) {
      if (a[i] != b[i]) return puts("NO"), 0;
    }
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%d ", b[i]);
}
