#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<int> first(q + 1, -1);
  vector<int> last(q + 1, -1);
  for (int i = 0; i < n; ++i) {
    if (a[i] == 0) {
      continue;
    }
    if (first[a[i]] == -1) {
      first[a[i]] = i;
    }
    last[a[i]] = i;
  }
  vector<int> starts(n, -1);
  vector<int> ends(n, -1);
  for (int i = 1; i <= q; ++i) {
    if (first[i] != -1) {
      starts[first[i]] = i;
    }
    if (last[i] != -1) {
      ends[last[i]] = i;
    }
  }
  set<int> s;
  int lastZero = -1;
  bool noMax = true;
  for (int i = 0; i < n; ++i) {
    if (starts[i] != -1) {
      s.insert(starts[i]);
    }
    if (a[i] == 0) {
      if (s.empty()) {
        a[i] = 1;
      } else {
        a[i] = *s.rbegin();
      }
      lastZero = i;
    } else if (*s.rbegin() > a[i]) {
      cout << "NO" << endl;
      return 0;
    }
    if (a[i] == q) {
      noMax = false;
    }
    if (ends[i] != -1) {
      s.erase(ends[i]);
    }
  }
  if (noMax) {
    if (lastZero != -1) {
      a[lastZero] = q;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int x : a) {
    cout << x << " ";
  }
  cout << endl;
}
