#include <bits/stdc++.h>
using namespace std;
int maxa = 0, a[200010], di[200010], n, q, ans[200010], one[200010];
stack<int> pq;
map<int, int> l;
map<int, int> r;
int d[200010][30];
void init() {
  int i, j;
  for (i = 1; i <= n; i++) {
    if (a[i] == 0)
      d[i][0] = 200010;
    else
      d[i][0] = a[i];
  }
  for (j = 1; (1 << j) <= n; j++)
    for (i = 1; i + (1 << j) <= n + 1; i++)
      d[i][j] = min(d[i][j - 1], d[i + (1 << (j - 1))][j - 1]);
}
int rmq(int L, int R) {
  int k = 0;
  while ((1 << (k + 1)) <= R - L + 1) k++;
  return min(d[L][k], d[R - (1 << k) + 1][k]);
}
int main() {
  int i, j, k, ju = 1;
  memset(d, 0, sizeof(d));
  l.clear();
  r.clear();
  memset(ans, 0, sizeof(ans));
  memset(one, 0, sizeof(one));
  scanf("%d%d", &n, &q);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  init();
  for (i = 1; i <= n; i++) {
    if (l.count(a[i]) == 0) {
      l[a[i]] = r[a[i]] = i;
    } else {
      r[a[i]] = i;
    }
  }
  for (i = 1; i <= q; i++) {
    di[l[i]] = di[r[i]] = i;
    if (l[i] == r[i]) one[l[i]] = 1;
  }
  for (i = 1; i <= n; i++) {
    if (d[i] == 0 && pq.empty()) continue;
    if (pq.empty()) {
      ans[i] = di[i];
      if (!one[i]) pq.push(di[i]);
    } else {
      int u = pq.top();
      if (di[i] == 0) {
        ans[i] = u;
      } else {
        ans[i] = di[i];
        if (u == di[i]) {
          if (rmq(l[di[i]], r[di[i]]) < di[i]) {
            ju = 0;
            break;
          }
          pq.pop();
        } else if (di[i] < u) {
          ju = 0;
          break;
        } else if (!one[i]) {
          pq.push(di[i]);
        }
      }
    }
  }
  int has = 0;
  for (i = 1; i <= n; i++)
    if (ans[i] == q) {
      has = 1;
      break;
    }
  if (!has) {
    for (i = 1; i <= n; i++)
      if (!a[i]) break;
    ans[i] = q;
  }
  for (i = 1; i <= n; i++)
    if (ans[i] == 0) ans[i] = ans[i - 1];
  for (i = n; i >= 1; i--)
    if (ans[i] == 0) ans[i] = ans[i + 1];
  int find = 0;
  for (i = 1; i <= n; i++) {
    if (ans[i] == q) {
      find = 1;
      break;
    }
  }
  if (!find) ju = 0;
  if (!ju) {
    cout << "NO";
  } else {
    cout << "YES" << endl;
    for (i = 1; i <= n; i++) printf("%d ", ans[i]);
  }
  return 0;
}
