#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[200001];
int v[200001];
int t[1000000];
const int mx = 9999999;
int ins(int i, int lo, int hi, int x, int y) {
  if (lo == hi) return t[i] = (y ? y : mx);
  int mid = (lo + hi) / 2;
  if (x <= mid)
    return t[i] = min(t[i], ins(i * 2, lo, mid, x, y));
  else
    return t[i] = min(t[i], ins(i * 2 + 1, mid + 1, hi, x, y));
}
int build(int i, int lo, int hi) {
  if (lo == hi) return t[i] = (a[lo] ? a[lo] : mx);
  int mid = (lo + hi) / 2;
  return t[i] = min(build(i * 2, lo, mid), build(i * 2 + 1, mid + 1, hi));
}
int query(int i, int lo, int hi, int l, int r) {
  if (lo > r || hi < l) return mx;
  if (l <= lo && hi <= r) return t[i];
  int mid = (lo + hi) / 2;
  return min(query(i * 2, lo, mid, l, r), query(i * 2 + 1, mid + 1, hi, l, r));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int i, j;
  int n, q;
  cin >> n >> q;
  for (i = 0; i < n; i++) cin >> a[i];
  if (a[0] == 0) {
    for (i = 1; i < n && a[i] == 0; i++)
      ;
    if (i == n) {
      cout << "YES\n";
      for (i = 0; i < n; i++) cout << q << ' ';
      return 0;
    }
    a[0] = a[i];
  }
  bool b = false;
  bool c = false;
  for (i = 0; i < n; i++) {
    if (a[i] == q) b = true;
  }
  for (i = 1; i < n; i++) {
    if (a[i] == 0) {
      if (b)
        a[i] = a[i - 1];
      else {
        a[i] = q;
        b = true;
      }
    }
  }
  build(1, 0, n - 1);
  memset(v, -1, sizeof(v));
  for (i = 0; i < n; i++) {
    if (a[i] == 0) {
      c = true;
      continue;
    }
    if (v[a[i]] != -1) {
      if (query(1, 0, n - 1, v[a[i]] + 1, i - 1) < a[i]) {
        cout << "NO";
        return 0;
      }
    } else
      v[a[i]] = i;
    if (a[i] == q) b = true;
  }
  if (!b && !c) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (i = 0; i < n; i++) {
    if (a[i] == 0) {
      if (b)
        cout << 1 << ' ';
      else {
        cout << q << ' ';
        b = true;
      }
    } else
      cout << a[i] << ' ';
  }
}
