#include <bits/stdc++.h>
int a[800010];
struct node {
  int left, right, min, max;
} num[800010];
int id[200005];
int MIN(int a, int b) { return a < b ? a : b; }
int MAX(int a, int b) { return a > b ? a : b; }
int buildmin(int left, int right, int cnt) {
  int mid;
  num[cnt].left = left;
  num[cnt].right = right;
  if (left == right) return num[cnt].min = a[left];
  mid = (left + right) >> 1;
  return num[cnt].min = MIN(buildmin(left, mid, cnt * 2),
                            buildmin(mid + 1, right, cnt * 2 + 1));
}
int buildmax(int left, int right, int cnt) {
  int mid;
  num[cnt].left = left;
  num[cnt].right = right;
  if (left == right) return num[cnt].max = a[left];
  mid = (left + right) >> 1;
  return num[cnt].max = MAX(buildmax(left, mid, cnt * 2),
                            buildmax(mid + 1, right, cnt * 2 + 1));
}
int querymin(int left, int right, int cnt) {
  int mid;
  if (left == num[cnt].left && right == num[cnt].right) return num[cnt].min;
  mid = (num[cnt].left + num[cnt].right) >> 1;
  if (right <= mid)
    return querymin(left, right, cnt * 2);
  else if (left > mid)
    return querymin(left, right, cnt * 2 + 1);
  else
    return MIN(querymin(left, mid, cnt * 2),
               querymin(mid + 1, right, cnt * 2 + 1));
}
int querymax(int left, int right, int cnt) {
  int mid;
  if (left == num[cnt].left && right == num[cnt].right) return num[cnt].max;
  mid = (num[cnt].left + num[cnt].right) >> 1;
  if (right <= mid)
    return querymax(left, right, cnt * 2);
  else if (left > mid)
    return querymax(left, right, cnt * 2 + 1);
  else
    return MAX(querymax(left, mid, cnt * 2),
               querymax(mid + 1, right, cnt * 2 + 1));
}
int main() {
  int q, maxs = 0, mins = 100000000;
  int t, n, m, i, j, C, L, R;
  int flag = 0;
  scanf("%d%d", &n, &q);
  for (i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (a[i]) flag = 1;
    maxs = MAX(maxs, a[i]);
    mins = MIN(mins, a[i]);
  }
  if (maxs < q && mins > 0) {
    printf("NO\n");
    return 0;
  }
  if (flag == 0) {
    printf("YES\n");
    for (int i = 1; i <= n; i++) printf("%d ", q);
    printf("\n");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (maxs < q && a[i] == 0) {
      a[i] = q;
      break;
    }
  if (a[1] == 0) a[1] = 1;
  for (int i = 2; i <= n; i++)
    if (a[i] == 0) a[i] = a[i - 1];
  buildmin(1, n, 1);
  int mark = 0;
  for (int i = 1; i <= n; i++) {
    if (id[a[i]] != 0) {
      int tmp = querymin(id[a[i]], i, 1);
      if (tmp < a[i]) mark = 1;
    }
    id[a[i]] = i;
  }
  if (mark)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
    printf("\n");
  }
  return 0;
}
