#include <bits/stdc++.h>
using namespace std;
inline void io() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
void PV(vector<long long> v) {
  for (long long i = 0; i < (long long)v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
void PA(long long v[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cout << v[i] << " ";
  cout << endl;
}
void IA(long long a[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cin >> a[i];
}
const long long N = 2e5 + 7, Mod = 1e9 + 7;
long long n, q, ctq = 0;
long long a[N], aa[N], b[N], c[N];
bool chk() {
  for (long long i = 1; i < n + 1; i++) {
    if (a[i] == 0) continue;
    if (a[i] > q) return false;
    if (a[i] == q) ctq++;
    if (b[a[i]] != 0) {
      if (i && a[i - 1] < a[i]) {
        return false;
      }
    }
    b[a[i]] = i;
  }
  for (long long i = n; i > 0; i--) {
    if (a[i] == 0) continue;
    if (c[a[i]] != 0) {
      if ((n - i) && a[i + 1] < a[i]) {
        return false;
      }
    }
    c[a[i]] = i;
  }
  return true;
}
void solve() {
  cin >> n >> q;
  IA(aa, n, 1);
  for (long long i = 1; i <= n; i++) {
    a[i] = aa[i];
    if (aa[i] == q) ctq++;
  }
  if (a[n] == 0) a[n] = 1;
  for (long long i = n - 1; i > 0; i--) {
    if (a[i] == 0) {
      a[i] = a[i + 1];
    }
  }
  for (long long i = 1; ctq == 0 && i <= n; i++) {
    if (aa[i] == 0) {
      a[i] = q;
      ctq++;
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (a[i] == q) ctq++;
  }
  if ((!chk()) || ctq == 0) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  PA(a, n, 1);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t1 = 1;
  while (t1--) {
    solve();
  }
}
