#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int seed = 31;
const int inf = 0x3f3f3f3f;
const double eps = 1e-3;
const double pi = acos(-1.0);
int a[maxn], b[maxn];
vector<int> v[maxn];
struct node {
  int l, r, vl, lz;
} tree[maxn * 4];
void putadd(int id) { tree[id].vl = tree[id * 2].vl + tree[id * 2 + 1].vl; }
void build(int id, int l, int r) {
  tree[id].l = l, tree[id].r = r, tree[id].lz = 0, tree[id].vl = 0;
  if (l == r) return;
  int m = (l + r) / 2;
  build(id * 2, l, m);
  build(id * 2 + 1, m + 1, r);
  putadd(id);
}
int vl, ql, qr;
void putup(int id, int vl) {
  tree[id].lz = vl;
  tree[id].vl = (tree[id].r - tree[id].l + 1) * vl;
}
void pushdown(int id) {
  if (tree[id].lz) {
    putup(id * 2, tree[id].lz);
    putup(id * 2 + 1, tree[id].lz);
    tree[id].lz = 0;
  }
}
void update(int id) {
  int l = tree[id].l, r = tree[id].r;
  if (ql > r || qr < l) return;
  if (ql <= l && qr >= r) {
    putup(id, vl);
    return;
  }
  pushdown(id);
  int m = (l + r) / 2;
  update(id * 2);
  update(id * 2 + 1);
  putadd(id);
}
void query(int id) {
  int l = tree[id].l, r = tree[id].r;
  if (l == r) {
    b[l] = tree[id].vl;
    return;
  }
  pushdown(id);
  query(id * 2);
  query(id * 2 + 1);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", a + i), v[a[i]].push_back(i);
  build(1, 1, n + 1);
  v[0].push_back(n + 1);
  for (int i = 1; i <= m; i++) {
    if (v[i].empty()) {
      ql = v[0][0], qr = v[0][0], vl = i;
      update(1);
      continue;
    }
    ql = v[i][0], qr = v[i][v[i].size() - 1], vl = i;
    update(1);
  }
  query(1);
  int last = -1;
  bool flag = 0;
  for (int i = 1; i <= n && !flag; i++)
    if (b[i]) flag = 1;
  for (int i = 1; i <= n; i++) {
    if (last == -1 && !b[i]) last = 0;
    if (last == 0 && b[i]) {
      last = i;
      break;
    }
  }
  if (!flag) {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      if (i > 1) printf(" ");
      printf("%d", m);
    }
    for (int i = 1; i <= n; i++) {
      if (!b[i]) {
        if (i == 1)
          b[i] = b[last];
        else
          b[i] = b[i - 1], last = i;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (i > 1) printf(" ");
      printf("%d", b[i]);
    }
    return 0;
  }
  int i = 1, j = 1;
  while (i <= n && j <= n && ((a[i] == b[j]) || (!a[i] && a[i] != b[j])))
    ++i, ++j;
  if (i == n + 1 && j == n + 1) {
    if (b[n + 1] == m && b[n] != m) {
      printf("NO\n");
      return 0;
    }
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      if (!b[i]) {
        if (i == 1)
          b[i] = b[last];
        else
          b[i] = b[i - 1], last = i;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (i > 1) printf(" ");
      printf("%d", b[i]);
    }
  } else
    printf("NO\n");
  return 0;
}
