#include <bits/stdc++.h>
using namespace std;
class SegmentTree {
 private:
  long long n;
  vector<long long> st, lazy;
  long long query(int p, int left, int right, int i, int j) {
    if (i > right || j < left) return 0;
    if (lazy[p]) {
      st[p] = lazy[p];
      if (left != right) {
        lazy[p * 2] = lazy[p];
        lazy[p * 2 + 1] = lazy[p];
      }
      lazy[p] = 0;
    }
    if (left >= i && right <= j) return st[p];
    int mid = (left + right) / 2;
    return query(p * 2, left, mid, i, j) +
           query(p * 2 + 1, mid + 1, right, i, j);
  }
  void update(int p, int left, int right, int i, int j, long long value) {
    if (lazy[p]) {
      st[p] = lazy[p];
      if (left != right) {
        lazy[p * 2] = lazy[p];
        lazy[p * 2 + 1] = lazy[p];
      }
      lazy[p] = 0;
    }
    if (i > right || j < left) return;
    if (left >= i && right <= j) {
      st[p] = value;
      if (left != right) {
        lazy[p * 2] = value;
        lazy[p * 2 + 1] = value;
      }
      return;
    }
    int mid = (left + right) / 2;
    update(p * 2, left, mid, i, j, value);
    update(p * 2 + 1, mid + 1, right, i, j, value);
    st[p] = max(st[p * 2], st[p * 2 + 1]);
  }

 public:
  SegmentTree(int sz) : n(sz), st(sz * 4, 0), lazy(sz * 4, 0) {}
  long long query(int i, int j) { return query(1, 1, n, i, j); }
  void update(int i, int j, long long value) { update(1, 1, n, i, j, value); }
};
int v[200100], first[200100], last[200100], ans[200100];
int color[200100];
int main() {
  int n, q;
  cin >> n >> q;
  int f = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &v[i]);
    last[v[i]] = i;
    if (not first[v[i]]) first[v[i]] = i;
    if (v[i] && not f) f = i;
  }
  if (f == 0) {
    cout << "YES" << endl;
    cout << q;
    for (int i = 2; i <= n; i++) printf(" %d", q);
    cout << endl;
    return 0;
  }
  if (not last[q]) {
    if (not last[0]) {
      cout << "NO" << endl;
      return 0;
    }
    last[q] = last[0];
    first[q] = last[0];
    v[last[0]] = q;
  }
  if (not v[1]) {
    first[v[f]] = 1;
    v[1] = v[f];
  }
  SegmentTree st(n);
  for (int k = 1; k <= q; k++) {
    st.update(first[k], last[k], k);
  }
  for (int i = 1; i <= n; i++) {
    if (not v[i]) continue;
    if (st.query(i, i) != v[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  cout << st.query(1, 1);
  for (int i = 2; i <= n; i++) {
    if (not st.query(i, i)) {
      int aux = st.query(i - 1, i - 1);
      printf(" %d", aux);
      st.update(i, i, aux);
      continue;
    }
    printf(" %d", st.query(i, i));
  }
  cout << endl;
  return 0;
}
