#include <bits/stdc++.h>
using namespace std;
struct SGT {
  vector<int> t;
  void build(int u, int b, int e, vector<int>& a) {
    if (b == e) {
      t[u] = a[b];
      return;
    }
    int mid = (b + e) >> 1;
    build(u << 1, b, mid, a);
    build(u << 1 | 1, mid + 1, e, a);
    t[u] = min(t[u << 1], t[u << 1 | 1]);
  }
  int query(int u, int b, int e, int i, int j) {
    if (i > e or j < b) return INT_MAX;
    if (i <= b and e <= j) return t[u];
    int mid = (b + e) >> 1;
    int p1 = query(u << 1, b, mid, i, j);
    int p2 = query(u << 1 | 1, mid + 1, e, i, j);
    return min(p1, p2);
  }
  SGT(int n, vector<int>& a) {
    t.resize(n * 4, 0);
    build(1, 1, n, a);
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  vector<int> a(n + 1);
  map<int, pair<int, int>> id;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    (a[i] == 0 ? a[i] = INT_MAX : a[i] = a[i]);
    if (id[a[i]].first == 0) {
      id[a[i]].first = i;
      continue;
    }
    id[a[i]].second = i;
  }
  SGT T(n, a);
  bool bad = false;
  for (int x = 1; x <= q; x++) {
    if (id[x].first != 0 and id[x].second != 0) {
      int cur = id[x].first;
      int nxt = id[x].second;
      if (cur + 1 <= nxt - 1) {
        int _min = T.query(1, 1, n, cur + 1, nxt - 1);
        if (_min < x) {
          bad = true;
          break;
        }
      }
    }
  }
  if (bad) {
    cout << "NO" << '\n';
    return 0;
  }
  auto good = [&](int x) { return id[x].first != 0 or id[x].second != 0; };
  if (!good(q) and !good(INT_MAX)) {
    cout << "NO" << '\n';
    return 0;
  }
  if (!good(q) and good(INT_MAX)) {
    a[id[INT_MAX].first] = q;
  }
  int now = -1;
  for (int i = 1; i <= n; i++) {
    if (a[i] != INT_MAX) {
      now = a[i];
    } else if (a[i] == INT_MAX and now != -1) {
      a[i] = now;
    }
  }
  now = -1;
  for (int i = n; i >= 1; i--) {
    if (a[i] != INT_MAX) {
      now = a[i];
    } else if (a[i] == INT_MAX and now != -1) {
      a[i] = now;
    }
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) {
    if (i > 1) {
      cout << ' ';
    }
    cout << a[i];
  }
  cout << '\n';
}
