#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[200005];
int min_index[200005];
int max_index[200005];
int fen[200005];
int *st;
int minVal(int x, int y) { return (x < y) ? x : y; }
int getMid(int s, int e) { return s + (e - s) / 2; }
int RMQUtil(int *st, int ss, int se, int qs, int qe, int index) {
  if (qs <= ss && qe >= se) return st[index];
  if (se < qs || ss > qe) return INT_MAX;
  int mid = getMid(ss, se);
  return minVal(RMQUtil(st, ss, mid, qs, qe, 2 * index + 1),
                RMQUtil(st, mid + 1, se, qs, qe, 2 * index + 2));
}
int RMQ(int *st, int n, int qs, int qe) {
  if (qs < 0 || qe > n - 1 || qs > qe) {
    cout << "Invalid Input";
    return -1;
  }
  return RMQUtil(st, 0, n - 1, qs, qe, 0);
}
int constructSTUtil(int arr[], int ss, int se, int *st, int si) {
  if (ss == se) {
    st[si] = arr[ss];
    return arr[ss];
  }
  int mid = getMid(ss, se);
  st[si] = minVal(constructSTUtil(arr, ss, mid, st, si * 2 + 1),
                  constructSTUtil(arr, mid + 1, se, st, si * 2 + 2));
  return st[si];
}
int *constructST(int arr[], int n) {
  int x = (int)(ceil(log2(n)));
  int max_size = 2 * (int)pow(2, x) - 1;
  int *st = new int[max_size];
  constructSTUtil(arr, 0, n - 1, st, 0);
  return st;
}
int get_min(int start, int end) { return RMQ(st, n, start, end); }
int main() {
  bool pos = true;
  cin >> n >> q;
  int zero_cnt = 0;
  int mx_cnt = 0;
  int first_nonzero = -1;
  for (int i = 0; i <= q; i++) {
    min_index[i] = -1;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0 && first_nonzero == -1) first_nonzero = a[i];
    if (a[i] == 0) {
      a[i] = q + 1;
      zero_cnt += 1;
    }
    if (a[i] == q) {
      mx_cnt += 1;
    }
    if (min_index[a[i]] < 0) {
      min_index[a[i]] = i;
    }
    max_index[a[i]] = i;
  }
  if (first_nonzero == -1) first_nonzero = q;
  st = constructST(a, n);
  for (int i = 1; i <= q; i++) {
    int start = min_index[i];
    int end = max_index[i];
    if (start >= 0 && get_min(start, end) < i) {
      pos = false;
    }
    if (start < 0 && i == q && zero_cnt == 0) {
      pos = false;
    }
  }
  if (!pos) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  if (mx_cnt == 0) {
    for (int i = 0; i < n; i++) {
      if (a[i] == (q + 1)) {
        a[i] = q;
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] <= q) {
      first_nonzero = a[i];
    }
    cout << first_nonzero << " ";
  }
  cout << "\n";
  return 0;
}
