#include <bits/stdc++.h>
using namespace std;
const int RLEN = 1 << 18 | 1;
inline char nc() {
  static char ibuf[RLEN], *ib, *ob;
  (ib == ob) && (ob = (ib = ibuf) + fread(ibuf, 1, RLEN, stdin));
  return (ib == ob) ? -1 : *ib++;
}
inline int rd() {
  char ch = nc();
  int i = 0, f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (isdigit(ch)) {
    i = (i << 1) + (i << 3) + ch - '0';
    ch = nc();
  }
  return i * f;
}
const int N = 2e5 + 50;
int n, q, a[N], anc[N];
vector<int> pos[N];
inline int ga(int x) { return (anc[x] == x) ? x : (anc[x] = ga(anc[x])); }
inline void merge(int x, int y) {
  if (!x || y > n) return;
  x = ga(x);
  y = ga(y);
  anc[x] = y;
}
inline bool check() {
  for (int i = 1; i <= n; i++) anc[i] = i;
  for (int i = 2; i <= n; i++)
    if (a[i] == a[i - 1]) merge(i - 1, i);
  for (int i = q; i >= 1; i--) {
    for (int j = 0; j < pos[i].size(); ++j)
      if (ga(pos[i][j]) != ga(pos[i].front())) return false;
    for (int j = 0; j < pos[i].size(); ++j)
      merge(pos[i][j] - 1, pos[i][j]), merge(pos[i][j] + 1, pos[i][j]);
  }
  return true;
}
int main() {
  n = rd(), q = rd();
  for (int i = 1; i <= n; i++) {
    a[i] = rd();
    anc[i] = i;
    pos[a[i]].push_back(i);
    if (a[i] > q) {
      puts("NO");
      return 0;
    }
  }
  int l = 1;
  while (a[l]) ++l;
  for (int r; l <= n;) {
    r = l;
    while (r + 1 < n && !a[r + 1]) ++r;
    int val = max(a[l - 1], a[r + 1]);
    for (int i = l; i <= r; i++) a[i] = val, pos[val].push_back(i);
    l = r + 1;
    while (a[l]) ++l;
  }
  if (!a[1]) {
    puts("YES");
    for (int i = 1; i <= n; i++) printf("%d ", q);
  } else if (check()) {
    if (!pos[0].size() && !pos[q].size())
      puts("NO");
    else {
      if (!pos[q].size()) a[pos[0].front()] = q;
      puts("YES");
      for (int i = 1; i <= n; i++) printf("%d ", a[i]);
    }
  } else
    puts("NO");
}
