#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= M;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % M;
    a = a * a % M;
  }
  return res % M;
}
const int N = 2e5 + 10;
int a[N];
int segt[5 * N];
map<int, int> m;
void construct(int l, int r, int pos) {
  if (l > r) return;
  if (l == r) {
    segt[pos] = a[l];
    return;
  }
  int mid = (l + r) / 2;
  construct(l, mid, 2 * pos + 1);
  construct(mid + 1, r, 2 * pos + 2);
  segt[pos] = min(segt[2 * pos + 1], segt[2 * pos + 2]);
}
int query(int l, int r, int pos, int ql, int qr) {
  if (l > r || ql > r || qr < l) return INT_MAX;
  if (ql <= l && qr >= r) return segt[pos];
  if (l == r) return INT_MAX;
  int mid = (l + r) / 2;
  return min(query(l, mid, 2 * pos + 1, ql, qr),
             query(mid + 1, r, 2 * pos + 2, ql, qr));
}
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  bool okq = 0;
  int z = 0;
  int mini = M, maxi = -1;
  for (int i = 0; i < n; ++i) {
    if (a[i] == q) okq = 1;
    mini = min(mini, a[i]);
    maxi = max(maxi, a[i]);
    if (a[i] == 0) z++;
  }
  if (z == n) {
    puts("YES");
    for (int i = 0; i < n; ++i) {
      printf("%d ", q);
    }
    return 0;
  }
  if (mini > 0 && maxi < q) {
    puts("NO");
    return 0;
  }
  if (okq == 0) {
    for (int i = n - 1; i >= 0; --i) {
      if (a[i] == 0) {
        a[i] = q;
        break;
      }
    }
  }
  for (int i = 1; i < n; ++i) {
    if (a[i] == 0) a[i] = a[i - 1];
  }
  for (int i = n - 2; i >= 0; --i) {
    if (a[i] == 0) a[i] = a[i + 1];
  }
  construct(0, n - 1, 0);
  int l[q + 3], r[q + 3];
  for (int i = 0; i < n; ++i) {
    if (m.count(a[i])) continue;
    m[a[i]]++;
    l[a[i]] = i;
  }
  m.clear();
  for (int i = n - 1; i >= 0; --i) {
    if (m.count(a[i])) continue;
    m[a[i]]++;
    r[a[i]] = i;
  }
  for (int i = 1; i <= q; ++i) {
    if (m.count(i)) {
      int x = l[i], y = r[i];
      int mm = query(0, n - 1, 0, x, y);
      if (mm < i) {
        puts("NO");
        return 0;
      }
    }
  }
  puts("YES");
  for (int i = 0; i < n; ++i) printf("%d ", a[i]);
}
