#include <bits/stdc++.h>
using namespace std;
int n, q, a[200005], Minloc[200005], Maxloc[200005];
int dp[21][200005], RMQ[21][200005], lg[200005];
int main() {
  scanf("%d%d", &n, &q);
  memset(Minloc, 0x3f, sizeof Minloc);
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i])
      Maxloc[a[i]] = max(Maxloc[a[i]], i), Minloc[a[i]] = min(Minloc[a[i]], i),
      RMQ[0][i] = a[i];
    else
      flag = i, RMQ[0][i] = q + 1;
  }
  if ((!Maxloc[q])) {
    if (!flag) {
      puts("NO");
      return 0;
    }
    dp[0][flag] = q;
  }
  for (int j = 1; j < 21; j++)
    for (int i = 1; i <= n; i++)
      if (i + (1 << j - 1) < 200005)
        RMQ[j][i] = min(RMQ[j - 1][i], RMQ[j - 1][i + (1 << j - 1)]);
  for (int sum = 1, i = 0; sum < 200005; sum <<= 1, i++) lg[sum] = i;
  for (int i = 2; i < 200005; i++) lg[i] = max(lg[i], lg[i - 1]);
  for (int i = q; i >= 1; i--) {
    if (Maxloc[i]) {
      int u = Minloc[i], v = Maxloc[i], tmp;
      tmp = lg[v - u + 1];
      if (min(RMQ[tmp][u], RMQ[tmp][v - (1 << tmp) + 1]) < i) {
        puts("NO");
        return 0;
      }
      dp[tmp][u] = max(dp[tmp][u], i),
      dp[tmp][v - (1 << tmp) + 1] = max(dp[tmp][v - (1 << tmp) + 1], i);
    }
  }
  puts("YES");
  for (int j = 21 - 1; j > 0; j--)
    for (int i = 1; i <= n; i++)
      dp[j - 1][i] = max(dp[j - 1][i], dp[j][i]),
             dp[j - 1][i + (1 << j - 1)] =
                 max(dp[j - 1][i + (1 << j - 1)], dp[j][i]);
  for (int i = 1; i < n; i++)
    if (!dp[0][i])
      printf("1 ");
    else
      printf("%d ", dp[0][i]);
  if (!dp[0][n])
    printf("1\n");
  else
    printf("%d\n", dp[0][n]);
}
