#include <bits/stdc++.h>
using namespace std;
const int MAXN = (2e5 + 3);
const int INF = INT_MAX / 2;
struct rmq {
  vector<vector<int> > table;
  rmq(vector<int> &v) : table(v.size() + 1, vector<int>(20)) {
    int n = v.size() + 1;
    for (int i = 0; i < n; i++) table[i][0] = v[i];
    for (int j = 1; (1 << j) <= n; j++)
      for (int i = 0; i + (1 << j - 1) < n; i++)
        table[i][j] = min(table[i][j - 1], table[i + (1 << j - 1)][j - 1]);
  }
  int query(int a, int b) {
    int j = 31 - __builtin_clz(b - a + 1);
    return min(table[a][j], table[b - (1 << j) + 1][j]);
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  while (cin >> n >> q) {
    vector<int> v(n);
    vector<int> first(MAXN, -1), last(MAXN, -1);
    bool isq = false;
    for (int i = 0; i < n; i++) cin >> v[i], isq |= (v[i] == q);
    if (!isq) {
      for (int i = 0; i < n; i++) {
        if (v[i] == 0) {
          v[i] = q;
          isq = true;
          break;
        }
      }
      if (!isq) {
        cout << "NO" << '\n';
        continue;
      }
    }
    for (int i = 0; i < n - 1; i++) {
      if (v[i] != 0 && v[i + 1] == 0) v[i + 1] = v[i];
    }
    for (int i = n - 1; i >= 1; i--) {
      if (v[i] != 0 && v[i - 1] == 0) v[i - 1] = v[i];
    }
    for (int i = 0; i < n; i++) {
      if (first[v[i]] == -1) first[v[i]] = i;
      last[v[i]] = i;
    }
    rmq ds(v);
    bool ok = true;
    for (int i = MAXN - 1; i >= 1; i--) {
      if (first[i] != -1) {
        ok &= ds.query(first[i], last[i]) >= i;
      }
    }
    if (!ok)
      cout << "NO" << '\n';
    else {
      cout << "YES" << '\n';
      for (int i = 0; i < n; i++) {
        cout << v[i] << " ";
      }
      cout << '\n';
    }
  }
  return 0;
}
