#include <bits/stdc++.h>
using namespace std;
inline int read() {
  register int x = 0, t = 1;
  register char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = -1, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
  return x * t;
}
int n, Q;
int seq[200200], ans[200200];
int lf[200200], rt[200200];
vector<int> V[200200];
set<int> S;
int main() {
  n = read();
  Q = read();
  for (int i = 1; i <= n; i++) ans[i] = seq[i] = read();
  for (int i = 1; i <= n; i++)
    if (seq[i] != 0) {
      if (lf[seq[i]] == 0) lf[seq[i]] = i;
      rt[seq[i]] = i;
    }
  for (int i = 1; i <= Q; i++)
    if (lf[i] != 0) {
      V[lf[i]].push_back(i);
      V[rt[i] + 1].push_back(-i);
    }
  bool flag = 1;
  bool usemax = (lf[Q] == 0);
  ans[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int sz = V[i].size(), j = 0; j < sz; j++)
      if (V[i][j] > 0)
        S.insert(V[i][j]);
      else
        S.erase(-V[i][j]);
    if (seq[i] == 0) {
      if (usemax == 1)
        ans[i] = Q, usemax = 0;
      else if (S.size())
        ans[i] = (*--S.end());
      else
        ans[i] = ans[i - 1];
      continue;
    }
    if (seq[i] != (*--S.end())) {
      flag = 0;
      break;
    }
  }
  int mx = 0;
  for (int i = 1; i <= n; i++) mx = max(mx, ans[i]);
  if (mx != Q) flag = 0;
  if (flag == 0)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}
