#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, sgn = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') sgn = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  return x * sgn;
}
const int N = 2e5 + 10;
int n, m, a[N], mx, L[N], R[N], pos[N];
set<int> s;
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) a[i] = read(), mx = max(mx, a[i]);
  for (int i = 1; i <= n; i++) {
    if (!pos[a[i]]) pos[a[i]] = i;
    L[i] = pos[a[i]];
  }
  for (int i = 1; i <= n; i++) pos[a[i]] = 0;
  for (int i = n; i >= 1; i--) {
    if (!pos[a[i]]) pos[a[i]] = i;
    R[i] = pos[a[i]];
  }
  for (int i = 1; i <= n; i++) {
    if (!a[i]) {
      if (mx < m)
        a[i] = m, mx = m;
      else if (s.size())
        a[i] = *(--s.end());
      else
        a[i] = 1;
    } else {
      if (L[i] == i) s.insert(a[i]);
      if (R[i] == i) s.erase(a[i]);
      if (s.size() && a[i] < *(--s.end())) return puts("NO"), 0;
    }
  }
  if (mx < m) return puts("NO"), 0;
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%d%c", a[i], " \n"[i == n]);
  return 0;
}
