#include <bits/stdc++.h>
using namespace std;
int a[200005], mn[200005 * 4];
pair<int, int> lor[200005];
void build(int idx, int lo, int hi) {
  if (lo == hi) {
    mn[idx] = a[lo];
    return;
  }
  int mid = (lo + hi) / 2;
  build(idx * 2, lo, mid);
  build(idx * 2 + 1, 1 + mid, hi);
  mn[idx] = min(mn[idx * 2], mn[idx * 2 + 1]);
}
int query(int idx, int lo, int hi, int l, int r) {
  if (hi < l || lo > r) return INT_MAX;
  if (l <= lo && hi <= r) return mn[idx];
  int mid = (lo + hi) / 2;
  int x = query(idx * 2, lo, mid, l, r);
  int y = query(idx * 2 + 1, 1 + mid, hi, l, r);
  return min(x, y);
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  int z = 0;
  bool oka = false;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == q && q) oka = true;
    lor[a[i]] = pair<int, int>(-1, -1);
    if (a[i] == 0) z++;
  }
  if (!q) {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) {
      cout << a[i] << " ";
    }
  } else if (z == n) {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) {
      cout << q << " ";
    }
  } else {
    for (int i = 2; i <= n; i++) {
      if (a[i] == 0) {
        a[i] = (oka == false ? q : a[i - 1]);
        oka = true;
      }
    }
    for (int i = n - 1; i; i--) {
      if (a[i] == 0) {
        a[i] = oka == false ? q : a[i + 1];
        oka = true;
      }
    }
    vector<int> v;
    for (int i = 1; i <= n; i++) {
      if (lor[a[i]].first == -1) {
        v.push_back(a[i]);
        lor[a[i]] = pair<int, int>(i, i);
      } else
        lor[a[i]].second = i;
    }
    build(1, 1, n);
    for (int i = 0; i < v.size(); i++) {
      if (query(1, 1, n, lor[v[i]].first, lor[v[i]].second) < v[i]) {
        n = -1;
        break;
      }
    }
    if (n == -1 || oka == false)
      cout << "NO";
    else {
      cout << "YES\n";
      for (int i = 1; i <= n; i++) cout << a[i] << " ";
    }
  }
  return 0;
}
