#include <bits/stdc++.h>
using namespace std;
const int maxn = 8e5 + 7;
int l[maxn], r[maxn];
struct node {
  int l, r, val, lazy;
};
vector<int> vec;
struct SegmTree {
  node tree[maxn];
  void build(int rt, int l, int r) {
    tree[rt].l = l;
    tree[rt].r = r;
    if (l == r) {
      tree[rt].val = 0;
      tree[rt].lazy = 0;
      vec.push_back(rt);
      return;
    }
    int mid = (l + r) >> 1;
    build((rt << 1), l, mid);
    build((rt << 1 | 1), mid + 1, r);
  }
  void pushdown(int rt) {
    if (tree[rt].lazy) {
      tree[(rt << 1)].lazy = tree[(rt << 1 | 1)].lazy = tree[rt].lazy;
      tree[rt].lazy = 0;
      if (tree[(rt << 1)].l == tree[(rt << 1)].r)
        tree[(rt << 1)].val = tree[(rt << 1)].lazy;
      if (tree[(rt << 1 | 1)].l == tree[(rt << 1 | 1)].r)
        tree[(rt << 1 | 1)].val = tree[(rt << 1 | 1)].lazy;
    }
  }
  void update(int rt, int l, int r, int val) {
    if (l <= tree[rt].l && tree[rt].r <= r) {
      if (tree[rt].l == tree[rt].r) tree[rt].val = val;
      tree[rt].lazy = val;
      return;
    }
    pushdown(rt);
    int mid = (tree[rt].l + tree[rt].r) >> 1;
    if (l <= mid) update((rt << 1), l, r, val);
    if (r > mid) update((rt << 1 | 1), l, r, val);
  }
  void alldown(int rt) {
    if (tree[rt].l == tree[rt].r) return;
    pushdown(rt);
    alldown((rt << 1));
    alldown((rt << 1 | 1));
  }
} t;
int ans[maxn], a[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  int n, q;
  scanf("%d%d", &n, &q);
  t.build(1, 1, n);
  memset(l, -1, sizeof(l));
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (l[a[i]] == -1) l[a[i]] = i;
    r[a[i]] = i;
  }
  for (int i = 1; i <= q; ++i) {
    if (l[i] == -1) continue;
    t.update(1, l[i], r[i], i);
  }
  t.alldown(1);
  for (int i = 0; i < vec.size(); ++i) ans[i + 1] = t.tree[vec[i]].val;
  if (l[q] == -1) {
    for (int i = 1; i <= n; ++i)
      if (a[i] == 0) {
        ans[i] = q;
        l[q] = i;
        break;
      }
  }
  if (l[q] == -1) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    if (ans[i] != 0 && a[i] != 0 && ans[i] != a[i]) {
      printf("NO\n");
      return 0;
    }
  printf("YES\n");
  for (int i = 2; i <= n; ++i)
    if (ans[i] == 0 && ans[i - 1] != 0) ans[i] = ans[i - 1];
  for (int i = n - 1; i >= 1; --i)
    if (ans[i] == 0 && ans[i + 1] != 0) ans[i] = ans[i + 1];
  for (int i = 1; i <= n; ++i) printf("%d%c", ans[i], i == n ? '\n' : ' ');
  return 0;
}
