#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
template <typename T>
istream& operator>>(istream& i, vector<T>& v) {
  for (auto& e : v) i >> e;
  return i;
}
template <typename T>
ostream& operator<<(ostream& i, vector<T>& v) {
  for (auto& e : v) i << e << " ";
  return i;
}
template <typename T1, typename T2>
istream& operator>>(istream& i, vector<pair<T1, T2>>& v) {
  for (auto& e : v) i >> e.first >> e.second;
  return i;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& i, vector<pair<T1, T2>>& v) {
  for (auto& e : v) i << e.first << " " << e.second << endl;
  return i;
}
bool isVowel(char x) {
  return x == 'a' || x == 'e' || x == 'o' || x == 'u' || x == 'i';
}
void _start() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  cin.tie(0);
}
template <typename T>
void _end(T out) {
  cout << out;
  exit(0);
}
vector<int> v;
vector<int> tree(4e5, -1);
int getMin(int l, int r, int lf, int rf, int idx) {
  if (lf > r || rf < l) return 1e9;
  if (lf == rf) return v[lf];
  if (lf > l && rf < r && tree[idx] != -1) return tree[idx];
  int m = (lf + rf) / 2;
  return tree[idx] = min(getMin(l, r, lf, m, idx * 2),
                         getMin(l, r, m + 1, rf, idx * 2 + 1));
}
int main() {
  _start();
  int n, q;
  cin >> n >> q;
  v = vector<int>(n);
  cin >> v;
  bool qin = 0;
  for (auto& i : v)
    if (i == q) {
      qin = 1;
      break;
    }
  int p = 1;
  for (auto& i : v) {
    if (i == 0 && !qin)
      i = q, qin = 1;
    else if (i == 0) {
      i = p;
    }
    p = i;
  }
  vector<int> f(q + 1), s(q + 1);
  for (int i = 0; i < n; i++)
    if (!f[v[i]]) f[v[i]] = i + 1;
  for (int i = n - 1; i >= 0; i--)
    if (!s[v[i]]) s[v[i]] = i + 1;
  for (int i = q; i >= 1; i--) {
    if (getMin(f[i] - 1, s[i] - 1, 0, n - 1, 1) < i) _end("NO");
  }
  if (f[q] == 0) _end("NO");
  cout << "YES\n";
  _end(v);
}
