#include <bits/stdc++.h>
using namespace std;
long long query(long long* st, long long si, long long s, long long e,
                long long qs, long long qe) {
  if (qe < s || qs > e) {
    return 1e9;
  }
  if (qs <= s && qe >= e) {
    return st[si];
  }
  long long mid = (s + e) / 2;
  return min(query(st, 2 * si + 1, s, mid, qs, qe),
             query(st, 2 * si + 2, mid + 1, e, qs, qe));
}
void constructST(long long* st, long long si, long long s, long long e,
                 long long a[]) {
  if (s == e) {
    st[si] = a[s];
    return;
  }
  long long mid = (s + e) / 2;
  constructST(st, 2 * si + 1, s, mid, a);
  constructST(st, 2 * si + 2, mid + 1, e, a);
  st[si] = min(st[2 * si + 1], st[2 * si + 2]);
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, q;
  cin >> n >> q;
  long long a[n];
  long long idx = -1;
  long long large = -1;
  long long zero = -1;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0 && idx == -1) {
      idx = i;
    }
    if (a[i] == q) {
      large = i;
    }
    if (a[i] == 0) {
      zero = i;
    }
  }
  if (idx == -1) {
    cout << "YES" << endl;
    for (long long i = 0; i < n; i++) {
      cout << q << ' ';
    }
    cout << endl;
    return 0;
  }
  if (large == -1) {
    if (zero == -1) {
      cout << "NO";
      return 0;
    } else {
      a[zero] = q;
    }
  }
  idx = -1;
  for (long long i = 0; i < n; i++) {
    if (a[i] != 0 && idx == -1) {
      idx = i;
    }
  }
  long long prev = -1;
  for (long long i = 0; i < n; i++) {
    if (a[i] != 0) {
      prev = i;
      continue;
    }
    if (prev == -1)
      a[i] = a[idx];
    else
      a[i] = a[prev];
  }
  long long util[q + 1][2];
  long long ct[q + 1];
  for (long long i = 1; i <= q; i++) {
    util[i][0] = -1;
    util[i][1] = -1;
    ct[i] = 0;
  }
  for (long long i = 0; i < n; i++) {
    if (util[a[i]][0] == -1) {
      util[a[i]][0] = i;
      util[a[i]][1] = i;
    } else
      util[a[i]][1] = i;
    ct[a[i]]++;
  }
  if (util[q][0] == -1) {
    cout << "NO" << endl;
    return 0;
  }
  long long st[4 * n];
  memset(st, 0, 4 * n * sizeof(long long));
  constructST(st, 0, 0, n - 1, a);
  for (long long i = q; i >= 1; i--) {
    if (util[i][0] == -1) continue;
    if (query(st, 0, 0, n - 1, util[i][0], util[i][1]) != i) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (long long i = 0; i < n; i++) {
    cout << a[i] << ' ';
  }
  return 0;
}
