#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 5;
map<long long, set<long long>> mp;
long long solve() {
  long long n, m;
  cin >> n >> m;
  long long arr[n], i;
  long long ca = 0, p = -1, cnt = 0;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    if (!arr[i]) p = i, cnt++;
  }
  if (cnt == n) {
    cout << "YES\n";
    for (i = 0; i < n - 1; i++) cout << 1 << " ";
    cout << m;
    return 0;
  }
  for (i = 0; i < n; i++) {
    if (arr[i] == m) {
      ca = 1;
    }
    long long j = i - 1;
    while ((j >= 0) && (arr[j] == 0)) {
      arr[j] = arr[j + 1];
      j--;
    }
    j = i + 1;
    while ((j < n) && (arr[j] == 0)) {
      arr[j] = arr[j - 1];
      j++;
    }
  }
  if ((!ca) && (p == -1)) {
    cout << "NO";
    return 0;
  }
  if (!ca) arr[p] = m;
  for (i = 0; i < n; i++) mp[arr[i]].insert(i);
  for (i = 1; i < n; i++) {
    if (arr[i] < arr[i - 1]) {
      if (mp[arr[i - 1]].lower_bound(i) != mp[arr[i - 1]].end()) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (i = 0; i < n; i++) cout << arr[i] << " ";
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long t = 1;
  while (t--) solve();
}
