#include <bits/stdc++.h>
using namespace std;
const int N = 200007;
template <class T>
struct fenwick_tree {
  vector<T> a;
  int n;
  void initialize(int k) {
    n = k;
    a.assign(n + 1, 0);
  }
  void update(int pos, T val) {
    for (; pos <= n; pos += pos & (-pos)) {
      a[pos] += val;
    }
  }
  T query(int pos) {
    T ans = 0;
    for (; pos >= 1; pos -= pos & (-pos)) {
      ans += a[pos];
    }
    return ans;
  }
  T query(int l, int r) { return query(r) - query(l - 1); }
};
int n, q, arr[N], first[N], last[N];
fenwick_tree<long long> it;
vector<int> pos[N];
int zeros_cnt;
pair<int, int> interval[N];
int ans[N];
vector<int> add_time[N], delete_time[N];
set<int, greater<int> > s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, j;
  scanf("%d %d", &n, &q);
  for (i = 1; i <= q; i++) {
    first[i] = last[i] = -1;
  }
  for (i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
    last[arr[i]] = i;
    pos[arr[i]].push_back(i);
    if (arr[i] == 0) ++zeros_cnt;
  }
  if (zeros_cnt == n) {
    printf("YES\n");
    for (i = 1; i <= n; i++) {
      if (i > 1) printf(" ");
      printf("%d", q);
    }
    printf("\n");
    return 0;
  }
  if (pos[q].empty()) {
    if (zeros_cnt == 0) {
      printf("NO\n");
      return 0;
    }
    for (i = 1; i <= n; i++) {
      if (arr[i] == 0) {
        arr[i] = q;
        first[q] = last[q] = i;
        pos[q].push_back(i);
        break;
      }
    }
  }
  for (i = n; i >= 1; i--) {
    first[arr[i]] = i;
  }
  it.initialize(n);
  for (i = 1; i <= n; i++) {
    if (arr[i] == 0) {
      it.update(i, 1);
    }
  }
  for (i = q; i >= 1; i--) {
    if (pos[i].empty()) {
      interval[i] = make_pair(0, 0);
      continue;
    }
    for (j = 0; j < (int)(pos[i].size()); j++) {
      it.update(pos[i][j], 1);
    }
    if (it.query(first[i], last[i]) != last[i] - first[i] + 1) {
      printf("NO\n");
      return 0;
    }
    add_time[first[i]].push_back(i);
    delete_time[last[i] + 1].push_back(i);
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) {
    for (j = 0; j < (int)(delete_time[i].size()); j++) {
      s.erase(delete_time[i][j]);
    }
    for (j = 0; j < (int)(add_time[i].size()); j++) {
      s.insert(add_time[i][j]);
    }
    if (!s.empty()) {
      ans[i] = *s.begin();
    }
  }
  for (i = 2; i <= n; i++) {
    if (ans[i - 1] != 0 && ans[i] == 0) {
      ans[i] = ans[i - 1];
    }
  }
  for (i = n - 1; i >= 1; i--) {
    if (ans[i + 1] != 0 && ans[i] == 0) {
      ans[i] = ans[i + 1];
    }
  }
  for (i = 1; i <= n; i++) {
    if (i > 1) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
