#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
int T[N], a[N], b[N], c[N];
vector<int> v;
int n, q;
void inti(int n, int b, int e) {
  if (b == e) {
    if (a[b] == 0)
      T[n] = q;
    else
      T[n] = a[b];
    return;
  }
  inti(n * 2, b, (b + e) / 2);
  inti(n * 2 + 1, (b + e) / 2 + 1, e);
  T[n] = min(T[n * 2], T[n * 2 + 1]);
}
int query(int n, int b, int e, int i, int j) {
  if (b > j || e < i) return N;
  if (b >= i && e <= j) return T[n];
  return min(query(n * 2, b, (b + e) / 2, i, j),
             query(n * 2 + 1, (b + e) / 2 + 1, e, i, j));
}
int main() {
  cin >> n >> q;
  for (int i = 1; i < N; i++) c[i] = n + 1;
  int id = 0, mx = 0;
  int c1 = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    mx = max(mx, a[i]);
    if (!b[a[i]] && a[i] != 0) {
      v.push_back(a[i]);
      if (!id) id = i;
    }
    if (a[i]) c1++;
    c[a[i]] = min(c[a[i]], i);
    b[a[i]] = max(b[a[i]], i);
  }
  if (mx != q && c1 == n) {
    puts("NO");
    return 0;
  }
  inti(1, 1, n);
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    int x1 = c[v[i]], x2 = b[v[i]];
    if (query(1, 1, n, x1, x2) < v[i]) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  if (id == 0) {
    for (int i = 1; i <= n; i++) printf("%d ", q);
  } else {
    int x = a[id];
    while (id > 1) {
      a[id] = x;
      id--;
    }
    x = 1;
    bool ck = 1;
    if (mx != q) {
      ck = 0;
      x = q;
    }
    for (int i = 1; i <= n; i++) {
      if (a[i] == 0) {
        printf("%d ", x);
        ck = 1;
      } else {
        printf("%d ", a[i]);
        if (ck) x = a[i];
      }
    }
    printf("\n");
  }
}
