#include <bits/stdc++.h>
using namespace std;
int N, M;
int T[200004 * 4];
int A[200004];
int fst[200004], lst[200004];
void build(int node, int left, int right) {
  if (left == right) {
    if (A[left] == 0)
      T[node] = 200004;
    else
      T[node] = A[left];
    return;
  }
  int m = (left + right) / 2;
  build(node * 2, left, m);
  build(node * 2 + 1, m + 1, right);
  T[node] = min(T[node * 2], T[node * 2 + 1]);
}
int query(int node, int left, int right, int l, int r) {
  if (r < l) return 200004;
  if (r < left || right < l) return 200004;
  if (l <= left && right <= r) return T[node];
  int m = (left + right) / 2;
  return min(query(node * 2, left, m, l, min(m, r)),
             query(node * 2 + 1, m + 1, right, max(l, m + 1), r));
}
int main(int argc, char **argv) {
  ios::sync_with_stdio(false);
  scanf("%d %d", &N, &M);
  int haszero = 0;
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i]);
    int a = A[i];
    if (a == 0) {
      haszero = 1;
      continue;
    }
    if (!fst[a]) fst[a] = i;
    lst[a] = i;
  }
  build(1, 1, N);
  int ok = 1;
  for (int a = 1; a <= M; a++) {
    if (fst[a] == 0) continue;
    int l = fst[a];
    int r = lst[a];
    int m = query(1, 1, N, l, r);
    if (m < a) {
      ok = 0;
      break;
    }
  }
  if (ok) {
    if (!haszero) {
      if (!fst[M]) ok = 0;
    } else {
      for (int i = 1; i <= N; i++) {
        if (A[i] == 0) {
          if (!fst[M]) {
            A[i] = M;
            fst[M] = i;
          } else if (i > 1)
            A[i] = A[i - 1];
          else if (i < N)
            A[i] = A[i + 1];
        }
      }
      for (int i = N; i >= 1; i--) {
        if (A[i] == 0) {
          if (i < N)
            A[i] = A[i + 1];
          else if (i > 1)
            A[i] = A[i - 1];
        }
      }
    }
  }
  if (!ok) {
    printf("NO\n");
  } else {
    printf("YES\n");
    for (int i = 1; i <= N; i++) printf("%d ", A[i]);
    printf("\n");
  }
  return 0;
}
