#include <bits/stdc++.h>
using namespace std;
const int N = 212345;
int seg[4 * N], v[N], tin[N], tout[N], ans[N];
int a, b, n, q;
void init(int r, int i, int j) {
  if (i == j) {
    seg[r] = v[i];
  } else {
    init(2 * r, i, (i + j) / 2);
    init(2 * r + 1, (i + j) / 2 + 1, j);
    seg[r] = min(seg[2 * r], seg[2 * r + 1]);
  }
}
int query(int r, int i, int j) {
  if (b < i || a > j) return 0x3f3f3f3f;
  if (i >= a && j <= b) {
    return seg[r];
  } else {
    int L = query(2 * r, i, (i + j) / 2);
    int R = query(2 * r + 1, (i + j) / 2 + 1, j);
    return min(L, R);
  }
}
void update(int r, int i, int j, int pos, int val) {
  if (pos < i || pos > j) return;
  if (i == j) {
    seg[r] = val;
  } else {
    update(2 * r, i, (i + j) / 2, pos, val);
    update(2 * r + 1, (i + j) / 2 + 1, j, pos, val);
    seg[r] = min(seg[2 * r], seg[2 * r + 1]);
  }
}
set<int> zeros;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> q;
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    if (v[i] == 0) {
      zeros.emplace(i);
      v[i] = 0x3f3f3f3f;
    } else {
      if (tin[v[i]] == 0) tin[v[i]] = i;
      tout[v[i]] = i;
      mx = max(mx, v[i]);
    }
  }
  if (zeros.size() == n) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) cout << q << " ";
    cout << endl;
    return 0;
  }
  if (mx != q and zeros.size() == 0) {
    cout << "NO" << endl;
    return 0;
  }
  init(1, 1, n);
  if (mx != q and zeros.size()) {
    auto it = zeros.begin();
    update(1, 1, n, *it, q);
    zeros.erase(it);
  }
  for (int i = q; i >= 1; i--) {
    if (tin[i] == 0) continue;
    a = tin[i];
    b = tout[i];
    if (query(1, 1, n) < i) {
      cout << "NO" << endl;
      return 0;
    }
    auto it = zeros.lower_bound(tin[i]);
    while (it != zeros.end() and *it <= tout[i]) {
      update(1, 1, n, *it, i);
      it = zeros.erase(it);
    }
  }
  for (int i = 1; i <= n; i++) {
    a = i;
    b = i;
    ans[i] = query(1, 1, n);
  }
  for (int i = 2; i <= n; i++) {
    if (ans[i] == 0x3f3f3f3f and ans[i - 1] != 0x3f3f3f3f) ans[i] = ans[i - 1];
  }
  for (int i = n - 1; i >= 1; i--) {
    if (ans[i] == 0x3f3f3f3f and ans[i + 1] != 0x3f3f3f3f) ans[i] = ans[i + 1];
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    assert(ans[i] != 0x3f3f3f3f);
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
