#include <bits/stdc++.h>
using namespace std;
int n, q, bl, a[200005], last[200005], st[200005], mx;
set<int> all;
set<int>::iterator it;
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = n; i > 0; i--) {
    mx = max(mx, a[i]);
    if (!last[a[i]]) last[a[i]] = i;
    if (!a[i]) bl = i;
  }
  if (bl > 0 && mx != q) a[bl] = q, st[q] = bl, last[q] = bl, mx = q;
  if (mx != q) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (!st[a[i]]) st[a[i]] = i;
  for (int i = 1; i <= n; i++) {
    if (i == st[a[i]]) {
      all.insert(a[i]);
    }
    it = --all.end();
    if (!a[i]) a[i] = (*it);
    if (a[i] != (*it)) {
      printf("NO\n");
      return 0;
    }
    if (i == last[a[i]]) all.erase(a[i]);
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    if (a[i])
      printf("%d ", a[i]);
    else
      printf("1 ");
  }
  return 0;
}
