#include <bits/stdc++.h>
using namespace std;
int n, q, i, j, stop, nr0;
int cs[200005], cd[200005], v[200005];
set<int> s;
int main() {
  cin >> n >> q;
  for (i = 1; i <= n; i++) {
    cin >> v[i];
    if (cs[v[i]] == 0 || i < cs[v[i]]) cs[v[i]] = i;
    cd[v[i]] = max(cd[v[i]], i);
    if (v[i] == 0) nr0++;
  }
  if (cs[q] == 0 && nr0 == 0) {
    cout << "NO";
    return 0;
  }
  for (i = 1; i <= n; i++) {
    if (v[i] == 0) continue;
    if (s.size() != 0) {
      if (v[i] < *s.rbegin()) {
        cout << "NO";
        return 0;
      }
    }
    if (cs[v[i]] == i) s.insert(v[i]);
    if (cd[v[i]] == i) s.erase(v[i]);
  }
  stop = 1e9;
  for (i = 1; i <= n; i++)
    if (v[i]) stop = min(stop, i);
  cout << "YES\n";
  if (stop == 1e9) {
    for (i = 1; i <= n; i++) cout << q << " ";
    return 0;
  }
  for (i = 1; i < stop; i++) cout << v[stop] << " ";
  for (i = stop; i <= n; i++) {
    if (v[i])
      cout << v[i] << " ";
    else {
      v[i] = v[i - 1];
      if (cs[q] != 0)
        cout << v[i - 1] << " ";
      else {
        cs[q] = 1e9;
        cout << q << " ";
      }
    }
  }
}
