#include <bits/stdc++.h>
using namespace std;
int tr[600010];
void build(int node, int l, int r, int a[]) {
  if (l == r) {
    tr[node] = a[l];
    return;
  }
  int m = (l + r) / 2;
  build(2 * node + 1, l, m, a);
  build(2 * node + 2, m + 1, r, a);
  tr[node] = min(tr[2 * node + 1], tr[2 * node + 2]);
}
int qu(int node, int l, int r, int x, int y) {
  if (y < l or x > r) return 1000000007;
  if (x >= l and y <= r) return tr[node];
  int m = (x + y) / 2;
  int le = qu(2 * node + 1, l, r, x, m);
  int ri = qu(2 * node + 2, l, r, m + 1, y);
  return min(le, ri);
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  int a[n], prev[n], next[n];
  bool rem[q + 1];
  for (int i = 0; i < q; ++i) rem[i + 1] = 1;
  int zero = 0, sav = -1;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i]) {
      rem[a[i]] = 0;
      sav = a[i];
    } else {
      ++zero;
      prev[i] = sav;
    }
  }
  if (zero == n) {
    cout << "YES\n";
    for (int i = 0; i < n; ++i) {
      cout << q << ' ';
    }
    return 0;
  }
  if (zero == 0 and rem[q]) {
    cout << "NO\n";
    return 0;
  }
  sav = -1;
  for (int i = n - 1; i >= 0; --i) {
    if (a[i] == 0)
      next[i] = sav;
    else
      sav = a[i];
  }
  bool need = 0, f = 0;
  if (rem[q]) need = 1;
  for (int i = 0; i < n; ++i) {
    if (a[i] == 0) {
      if (f) prev[i] = q;
      if (need) {
        need = 0;
        a[i] = q;
        f = 1;
      }
    } else
      f = 0;
  }
  if (need) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] == 0) {
      if (prev[i] == -1)
        a[i] = next[i];
      else
        a[i] = prev[i];
    }
  }
  f = 0;
  int left[q + 1], right[q + 1];
  memset(left, -1, sizeof left);
  memset(right, -1, sizeof right);
  build(0, 0, n - 1, a);
  for (int i = 0; i < n; ++i) {
    if (left[a[i]] == -1)
      left[a[i]] = right[a[i]] = i;
    else
      right[a[i]] = i;
  }
  for (int i = 1; i <= q; ++i) {
    if (left[i] == right[i]) continue;
    int m = qu(0, left[i], right[i], 0, n - 1);
    if (m < i) {
      f = 1;
      break;
    }
  }
  if (f)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 0; i < n; ++i) {
      cout << a[i] << ' ';
    }
  }
}
