#include <bits/stdc++.h>
using namespace std;
int uniset[200005];
int union_find(int x) {
  return uniset[x] ? uniset[x] = union_find(uniset[x]) : x;
}
int main() {
  int n, q;
  cin >> n >> q;
  vector<int> a(n + 1), left(q + 1, n + 1), right(q + 1, 0), ans(n + 1);
  int zero_pos = 0;
  left[1] = 1, right[1] = n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    left[a[i]] = min(i, left[a[i]]);
    right[a[i]] = max(i, right[a[i]]);
    if (a[i] == 0) {
      zero_pos = i;
    }
  }
  for (int i = q; i > 0; i--) {
    if (left[i] > right[i]) {
      if (zero_pos) {
        left[i] = right[i] = zero_pos;
      } else {
        cout << "NO\n";
        return 0;
      }
    } else {
      zero_pos = left[i];
    }
  }
  for (int i = q; i > 0; i--) {
    for (int j = union_find(left[i]); j <= right[i]; j = union_find(j)) {
      ans[j] = i;
      uniset[j] = j + 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] != 0 && ans[i] != a[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
