#include <bits/stdc++.h>
using namespace std;
int f[200005], l[200005], a[200005], dp[200005][50];
int n, q, have;
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (!a[i]) a[i] = 999999999, have = 1;
    dp[i][0] = a[i];
  }
  for (int i = 1; i <= n; i++)
    if (a[i] != 999999999)
      if ((!f[a[i]])) f[a[i]] = i;
  for (int i = n; i >= 1; i--)
    if (a[i] != 999999999)
      if ((!l[a[i]])) l[a[i]] = i;
  int s = int(floor(log2(n)));
  for (int j = 1; j <= s; j++)
    for (int i = 1; i <= (n - (1 << j) + 1); i++)
      dp[i][j] = min(dp[i][j - 1], dp[i + (1 << (j - 1))][j - 1]);
  for (int i = 1; i <= q; i++) {
    if (!f[i]) continue;
    int k = (int)floor(log2(l[i] - f[i] + 1));
    if (min(dp[f[i]][k], dp[l[i] - (1 << k) + 1][k]) < i) {
      printf("NO");
      return 0;
    }
  }
  if ((!have) && f[q] == 0) {
    printf("NO");
    return 0;
  }
  printf("YES\n");
  int flag = (f[q] > 0);
  a[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 999999999) {
      if (flag == 0)
        a[i] = q, flag = 1;
      else
        a[i] = a[i - 1];
    }
    printf("%d ", a[i]);
  }
  return 0;
}
