#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int seg[200005 * 4];
int arr[200005];
int mnind[200005], mxind[200005], vis[200005];
void build(int ind, int s, int e) {
  if (s == e) {
    seg[ind] = (arr[s] ? arr[s] : 1e9);
    return;
    ;
  }
  int lf = ind * 2, rt = lf + 1;
  int md = s + (e - s) / 2;
  build(lf, s, md);
  build(rt, md + 1, e);
  seg[ind] = min(seg[lf], seg[rt]);
}
int query(int ind, int ns, int ne, int qs, int qe) {
  if (qs > ne || qe < ns) return 1e9;
  if (qs <= ns && ne <= qe) return seg[ind];
  int lf = ind * 2, rt = lf + 1;
  int md = ns + (ne - ns) / 2;
  return min(query(lf, ns, md, qs, qe), query(rt, md + 1, ne, qs, qe));
}
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
    if (!vis[arr[i]]) mnind[arr[i]] = i, vis[arr[i]] = 1;
    mxind[arr[i]] = i;
  }
  if (!vis[q] && !vis[0]) {
    puts("NO");
    return 0;
  } else if (!vis[q]) {
    arr[mnind[0]] = q;
  }
  build(1, 0, n - 1);
  bool ok = true;
  for (int i = q; i >= 1; i--) {
    if (!vis[i]) continue;
    int mn = query(1, 0, n - 1, mnind[i], mxind[i]);
    if (mn < i) {
      ok = false;
      break;
    }
  }
  if (!ok) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = 0; i < n; i++) {
    if (!arr[i]) {
      if (!i)
        arr[i] = 1;
      else
        arr[i] = arr[i - 1];
    }
    printf("%d ", arr[i]);
  }
  return 0;
}
