#include <bits/stdc++.h>
using namespace std;
int a[200005], l[200005], r[200005];
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i <= q; i++) l[i] = INT_MAX;
  for (int i = 0; i <= q; i++) r[i] = INT_MIN;
  for (int i = 0; i < n; i++) l[a[i]] = min(i, l[a[i]]);
  for (int i = n - 1; i >= 0; i--) r[a[i]] = max(i, r[a[i]]);
  stack<int> st;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) continue;
    if (!st.empty() && st.top() > a[i]) {
      cout << "NO\n";
      return 0;
    }
    if (l[a[i]] == i) st.push(a[i]);
    if (r[a[i]] == i && st.top() == a[i])
      st.pop();
    else if (r[a[i]] == i && st.top() != a[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  if (!st.empty()) {
    cout << "NO\n";
    return 0;
  }
  if (l[q] == INT_MAX) {
    for (int i = 0; i < n; i++)
      if (a[i] == 0) {
        l[q] = r[q] = i;
        a[i] = q;
        break;
      }
  }
  if (l[q] == INT_MAX) {
    cout << "NO\n";
    return 0;
  }
  int j = 0;
  while (a[j] == 0) j++;
  for (int i = 0; i < j; i++) a[i] = a[j];
  for (int i = j; i < n; i++)
    if (a[i] == 0) a[i] = a[i - 1];
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
  return 0;
}
