#include <bits/stdc++.h>
using namespace std;
void __print(long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  long long f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
vector<long long> seg_tree;
long long n;
long long query(long long node, long long low, long long high, long long l,
                long long r) {
  if (l <= low && high <= r) {
    return seg_tree[node];
  }
  if (r < low || l > high) {
    return LLONG_MAX;
  }
  long long mid = (low + high) / 2;
  return min(query(2 * node, low, mid, l, r),
             query(2 * node + 1, mid + 1, high, l, r));
}
void update(long long i, long long val) {
  long long n = seg_tree.size() / 2;
  seg_tree[n + i] = val;
  long long current = (n + i) / 2;
  while (current > 0) {
    seg_tree[current] = min(seg_tree[2 * current], seg_tree[2 * current + 1]);
    current /= 2;
  }
}
void sol() {
  long long q;
  cin >> n >> q;
  long long n_true = n;
  vector<long long> arr(n);
  long long count_0 = 0, ma = 0;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    count_0 += (!arr[i]);
    ma = max(arr[i], ma);
  }
  if (ma != q && count_0 == 0) {
    cout << "NO" << endl;
    return;
  } else if (ma != q) {
    for (long long i = 0; i < n; i++) {
      if (arr[i] == 0) {
        arr[i] = q;
        break;
      }
    }
  }
  if (arr[0] == 0) {
    long long target;
    for (long long i = 0; i < n; i++) {
      if (arr[i]) {
        target = arr[i];
        break;
      }
    }
    arr[0] = target;
  }
  for (long long i = 1; i < n; i++) {
    if (arr[i] == 0) {
      arr[i] = arr[i - 1];
    }
  };
  vector<long long> first(q + 1, -1), last(q + 1, -1);
  for (long long i = 0; i < n; i++) {
    if (first[arr[i]] == -1) {
      first[arr[i]] = i;
    }
    last[arr[i]] = i;
  }
  while (n & (n - 1)) {
    arr.push_back(LLONG_MAX);
    n++;
  }
  seg_tree.resize(2 * n);
  for (long long i = 0; i < n; i++) {
    update(i, arr[i]);
  }
  for (long long i = 1; i <= q; i++) {
    if (first[i] != -1) {
      ;
      long long t = query(1, 0, n - 1, first[i], last[i]);
      ;
      ;
      if (t != i) {
        cout << "NO" << endl;
        return;
      }
    }
  }
  cout << "YES" << endl;
  for (long long i = 0; i < n_true; i++) {
    cout << arr[i] << ' ';
  }
  cout << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  sol();
  return 0;
}
