#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, z, q;
int ara[400000];
struct Info {
  int cc, lftval, rghval;
} segtree[800000];
int segtree2[800000], lazy[200000];
int nara[400000];
void relax(int node, int beg, int ed) {
  if (beg == ed) {
    nara[beg] = lazy[node];
    return;
  }
  lazy[2 * node] = lazy[node];
  lazy[2 * node + 1] = lazy[node];
  lazy[node] = 0;
}
void update2(int node, int beg, int ed, int i, int j, int val) {
  if (lazy[node]) relax(node, beg, ed);
  if (beg > ed || beg > j || ed < i) return;
  if (beg >= i && ed <= j) {
    lazy[node] = val;
    return;
  }
  int mid = (beg + ed) / 2;
  update2(2 * node, beg, mid, i, j, val);
  update2(2 * node + 1, mid + 1, ed, i, j, val);
}
void aramake(int node, int beg, int ed) {
  if (lazy[node]) relax(node, beg, ed);
  if (beg == ed) {
    return;
  }
  int mid = (beg + ed) / 2;
  aramake(2 * node, beg, mid);
  aramake(2 * node + 1, mid + 1, ed);
}
void update(int node, int beg, int ed, int i) {
  if (beg > ed || beg > i || ed < i) return;
  if (beg == ed) {
    segtree[node].cc = 1;
    segtree[node].lftval = 1;
    segtree[node].rghval = 1;
    return;
  }
  int mid = (beg + ed) / 2;
  update(2 * node, beg, mid, i);
  update(2 * node + 1, mid + 1, ed, i);
  segtree[node].cc = segtree[2 * node].cc + segtree[2 * node + 1].cc;
  if (segtree[2 * node].rghval == 1 && segtree[2 * node + 1].lftval == 1)
    segtree[node].cc--;
  segtree[node].rghval = segtree[2 * node + 1].rghval;
  segtree[node].lftval = segtree[2 * node].lftval;
}
vector<int> perqu[300000];
int main() {
  cin >> n >> q;
  int zero = -1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &ara[i]);
    if (ara[i] == 0) {
      zero = i;
    }
  }
  int cur = 1;
  while (ara[cur] == 0 && cur <= n) cur++;
  if (cur == n + 1) {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      printf("%d ", q);
    }
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (ara[i] == 0) continue;
    perqu[ara[i]].push_back(i);
  }
  if (zero == -1) {
    for (int i = q; i >= 1; i--) {
      if (i == q && perqu[i].size() == 0) {
        cout << "NO" << endl;
        return 0;
      }
      if (perqu[i].size() == 0) continue;
      for (int val : perqu[i]) update(1, 1, n, val);
      if (segtree[1].cc != 1) {
        cout << "NO" << endl;
        return 0;
      }
    }
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) printf("%d ", ara[i]);
  } else {
    for (int i = 1; i <= q; i++) {
      if (i == 1) {
        update2(1, 1, n, 1, n, 1);
        continue;
      }
      if (perqu[i].size() == 0) continue;
      int ss = perqu[i][0];
      int tt = perqu[i][perqu[i].size() - 1];
      update2(1, 1, n, ss, tt, i);
    }
    aramake(1, 1, n);
    bool ase = false;
    for (int i = 1; i <= n; i++) {
      if (nara[i] == q) {
        ase = true;
        break;
      }
    }
    if (!ase) nara[zero] = q;
    ase = false;
    for (int i = 1; i <= n; i++) {
      if (ara[i] == 0) continue;
      if (nara[i] != ara[i]) ase = true;
    }
    if (ase) {
      printf("NO\n");
    } else {
      printf("YES\n");
      for (int i = 1; i <= n; i++) {
        printf("%d ", nara[i]);
      }
    }
  }
  return 0;
}
