#include <bits/stdc++.h>
using namespace std;
const int siz = 2e5 + 10;
const long long modu = 1e9 + 7;
const int inf = 1e9 + 10;
int arr[siz], tree[4 * siz];
void build(int node, int start, int end) {
  if (start == end)
    tree[node] = arr[start];
  else {
    int mid = (start + end) / 2;
    build(2 * node, start, mid);
    build(2 * node + 1, mid + 1, end);
    tree[node] = min(tree[2 * node], tree[2 * node + 1]);
  }
}
int query(int node, int start, int end, int l, int r) {
  if (r < start || end < l) return inf;
  if (l <= start && end <= r) return tree[node];
  int mid = (start + end) / 2;
  int s1 = query(2 * node, start, mid, l, r);
  int s2 = query(2 * node + 1, mid + 1, end, l, r);
  return min(s1, s2);
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  int lef[q + 1], rig[q + 1];
  for (int i = 0; i <= q; i++) lef[i] = rig[i] = -1;
  for (int i = 0; i < n; i++) {
    rig[arr[i]] = i;
  }
  for (int i = n - 1; i >= 0; i--) {
    lef[arr[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    if (arr[i] == 0) arr[i] = q + 1;
  }
  build(1, 0, n - 1);
  int flag = 0;
  if (lef[q] == -1 && lef[0] == -1) flag = 1;
  if (lef[q] == -1 && lef[0] != -1)
    arr[lef[0]] = q, lef[q] = lef[0], rig[q] = lef[0];
  int ans[n], pre[n], post[n];
  for (int i = 0; i < n; i++) ans[i] = 1, pre[i] = post[i] = -1;
  for (int i = q; i >= 1; i--) {
    int l = lef[i], r = rig[i];
    if (l == -1) continue;
    pre[l] = i, post[r] = i;
    int val = query(1, 0, n - 1, l, r);
    if (val < i) flag = 1;
  }
  if (flag) {
    printf("NO\n");
  } else {
    printf("YES\n");
    multiset<int> pq;
    for (int i = 0; i < n; i++) {
      if (pre[i] != -1) pq.insert(pre[i]);
      multiset<int>::iterator it = pq.end();
      int maxi = 1;
      if (pq.size() > 0) {
        it--;
        maxi = *it;
      }
      ans[i] = maxi;
      if (post[i] != -1) pq.erase(pq.find(post[i]));
    }
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}
