#include <bits/stdc++.h>
using namespace std;
int arr[200100], st[200100], en[200100], nxt[200100];
set<int> ze;
stack<int> nx;
vector<int> rem;
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &arr[i]);
    if (!arr[i])
      ze.insert(i);
    else {
      int x = arr[i];
      if (st[x] == 0) st[x] = i;
      en[x] = i;
    }
  }
  int j = n;
  while (j >= 1 && arr[j] == 0) {
    j--;
  }
  if (j == 0) {
    printf("YES\n");
    for (int i = 0; i < n; ++i) printf("%d%c", q, " \n"[i == n - 1]);
    return 0;
  }
  int kk = j;
  for (int i = n; i >= 1; --i) {
    if (arr[i] == 0) {
      if (nx.empty()) continue;
      nxt[i] = nx.top();
    } else {
      while (!nx.empty() && arr[i] <= arr[nx.top()]) nx.pop();
      if (nx.empty())
        nxt[i] = 1e9;
      else
        nxt[i] = nx.top();
      nx.push(i);
    }
  }
  vector<int> sec;
  for (int i = 1; i <= q; ++i) {
    if (st[i] == 0) sec.push_back(i);
  }
  for (int i = q; i >= 1; --i) {
    int l = st[i], r = en[i];
    if (nxt[l] < r) return puts("NO");
    set<int>::iterator it = ze.lower_bound(l);
    rem.clear();
    while (it != ze.end()) {
      int x = *it;
      if (x > r) break;
      if (!sec.empty() && i < sec.back()) {
        arr[x] = sec.back();
        sec.pop_back();
      } else
        arr[x] = i;
      rem.push_back(x);
      it++;
    }
    for (auto a : rem) ze.erase(a);
  }
  vector<int> vec;
  for (auto a : ze) {
    vec.push_back(a);
  }
  for (int i = 0; i < vec.size(); ++i) {
    if (!sec.empty()) {
      int j = i + 1;
      while (j < vec.size() && vec[j] - vec[i] == 1) j++;
      j--;
      for (int k = i; k <= j; ++k) {
        int x = vec[k];
        arr[x] = sec.back();
      }
      i = j;
      sec.pop_back();
    } else {
      for (int k = i; k < vec.size(); ++k) {
        int x = vec[k];
        if (nxt[x] == 0) nxt[x] = kk;
        arr[x] = arr[nxt[x]];
      }
      break;
    }
  }
  if (!sec.empty() && sec.back() == q) return puts("NO");
  cout << "YES" << endl;
  for (int i = 1; i <= n; ++i) printf("%d%c", arr[i], " \n"[i == n]);
  return 0;
}
