#include <bits/stdc++.h>
using namespace std;
struct nd {
  int f;
  int s;
};
struct nd tree[4 * 200005 + 5];
int a[200005 + 5];
void build(int node, int st, int ee) {
  if (st == ee) {
    tree[node].f = a[st];
    tree[node].s = a[st];
  } else {
    int mid = (st + ee) / 2;
    build(2 * node, st, mid);
    build(2 * node + 1, mid + 1, ee);
    tree[node].f = min(tree[2 * node].f, tree[2 * node + 1].f);
    int mn = min(tree[2 * node].s, tree[2 * node + 1].s);
    if (mn == 0)
      tree[node].s = (tree[2 * node].s + tree[2 * node + 1].s);
    else {
      tree[node].s = min(tree[2 * node].s, tree[2 * node + 1].s);
    }
  }
}
nd query(int node, int s, int e, int fi, int li) {
  nd na, nb, res;
  if (li < s || e < fi) {
    res.f = 1000000;
    res.s = 1000000;
    return res;
  }
  if (fi <= s && e <= li) return tree[node];
  int mid = (s + e) / 2;
  na = query(2 * node, s, mid, fi, li);
  nb = query(2 * node + 1, mid + 1, e, fi, li);
  res.f = min(na.f, nb.f);
  int mn = min(na.s, nb.s);
  if (mn == 0 && na.s != 1000000 && nb.s != 1000000)
    res.s = (na.s + nb.s);
  else {
    res.s = mn;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int i, j, k;
  int n, q;
  cin >> n >> q;
  int b[n + 5], cz = 0;
  vector<int> idx[200005 + 5];
  int den = 0, mx = -1, h[200005] = {0};
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
    idx[a[i]].push_back(i);
    h[a[i]] = 1;
    if (a[i] > mx) mx = a[i];
    if (a[i] > q) den = 1;
    if (a[i] == 0) cz++;
  }
  build(1, 1, n);
  int fi, li;
  for (i = q; i >= 1; i--) {
    int siz = idx[i].size();
    if (siz >= 1) {
      fi = idx[i][0];
      li = idx[i][siz - 1];
      nd v = query(1, 1, n, fi, li);
      if (v.s != 0 && i != v.s) {
        den = 1;
        break;
      }
    }
  }
  if (den == 1 || (cz == 0 && mx < q))
    cout << "NO\n";
  else {
    cout << "YES\n";
    if (cz == n) {
      for (i = 1; i <= n; i++) {
        cout << q << " ";
      }
      cout << "\n";
      return 0;
    }
    for (i = 2; i <= n; i++) {
      if (h[q] == 0 && b[i] == 0) {
        b[i] = q;
        h[q] = 1;
      }
      if (b[i] == 0) b[i] = b[i - 1];
    }
    for (i = n - 1; i >= 1; i--) {
      if (b[i] == 0) b[i] = b[i + 1];
    }
    for (i = 1; i <= n; i++) {
      cout << b[i] << " ";
    }
  }
  return 0;
}
