#include <bits/stdc++.h>
using namespace std;
long long int a[200005], st[800005];
long long int bulid(long long int s, long long int e, long long int si) {
  if (s == e) {
    st[si] = a[s];
    return a[s];
  }
  long long int mid = (s + e) / 2;
  st[si] = min(bulid(s, mid, 2 * si + 1), bulid(mid + 1, e, 2 * si + 2));
  return st[si];
}
long long int quary(long long int s, long long int e, long long int si,
                    long long int qs, long long int qe) {
  if (s > qe || qs > e) return 300000005;
  if (s >= qs && e <= qe) return st[si];
  long long int mid = (s + e) / 2;
  return min(quary(s, mid, 2 * si + 1, qs, qe),
             quary(mid + 1, e, 2 * si + 2, qs, qe));
}
int main() {
  long long int t = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while (t--) {
    long long int i, j, k, m, n, ans = 0, cd = 0, q;
    cin >> n >> q;
    bool f = true, f0 = false, fm = true;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i])
        f = false;
      else
        f0 = true;
      if (a[i] == q) fm = false;
    }
    if (f) {
      cout << "YES"
           << "\n";
      for (int i = 0; i < n; i++) cout << q << " ";
      return 0;
    }
    if (fm && !f0) {
      cout << "NO";
      return 0;
    }
    if (fm)
      for (int i = 0; i < n; i++)
        if (a[i] == 0) {
          a[i] = q;
          break;
        }
    if (a[0] == 0) a[0] = 1;
    for (j = 0; j < n; j++) {
      if (a[j])
        m = a[j];
      else
        a[j] = m;
    }
    long long int s[200005];
    for (int i = 0; i < 200005; i++) s[i] = -1;
    bulid(0, n - 1, 0);
    for (i = 0; i < n; i++) {
      if (s[a[i]] == -1) {
        s[a[i]] = i;
        continue;
      }
      long long int x = quary(0, n - 1, 0, s[a[i]], i);
      if (x < a[i]) {
        cout << "NO";
        return 0;
      }
    }
    cout << "YES"
         << "\n";
    for (int i = 0; i < n; i++) cout << a[i] << " ";
  }
  return 0;
}
