#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("-ffloat-store")
using namespace std;
clock_t time_p = clock();
void aryanc403() {
  time_p = clock() - time_p;
  cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}
class cmp {
 public:
  bool operator()(long long int a, long long int b) { return a > b; }
};
void add(map<long long int, long long int> &m, long long int x) {
  map<long long int, long long int>::iterator jt;
  jt = m.find(x);
  if (jt == m.end())
    m.insert(make_pair(x, 1));
  else
    jt->second++;
}
void del(map<long long int, long long int> &m, long long int x) {
  map<long long int, long long int>::iterator jt;
  jt = m.find(x);
  if (jt->second == 1)
    m.erase(jt);
  else
    jt->second--;
}
bool cmp(const pair<long long int, long long int> &a,
         const pair<long long int, long long int> &b) {
  return a.first < b.first || (a.first == b.first && a.second < b.second);
}
const long long int INF = 0xFFFFFFFFFFFFFFFL;
const long long int mod = 1000000007L;
long long int T, n, i, m, j, k, in, cnt, l, q;
vector<long long int> a;
pair<long long int, long long int> ans[200005];
vector<long long int>::iterator it;
long long int seq[800005];
void insert(long long int root, long long int l, long long int r,
            long long int idx, long long int val) {
  if (l > r || idx < l || r < idx) return;
  if (seq[root] == 0) seq[root] = INF;
  if (l == r) {
    if (l == idx && seq[root] > val) seq[root] = val;
    return;
  }
  if (seq[root] > val) seq[root] = val;
  long long int m = l + ((r - l) >> 1);
  if (l <= idx && idx <= m) insert(2 * root, l, m, idx, val);
  if (m + 1 <= idx && idx <= r) insert(2 * root + 1, m + 1, r, idx, val);
}
long long int query(long long int root, long long int l, long long int r,
                    long long int L, long long int R) {
  if (l > r || R < l || r < L) return INF;
  if (seq[root] == 0) seq[root] = INF;
  if (L <= l && r <= R) return seq[root];
  long long int m = l + ((r - l) >> 1);
  long long int x, y;
  x = query(2 * root, l, m, L, R);
  y = query(2 * root + 1, m + 1, r, L, R);
  return x > y ? y : x;
}
bool check() {
  for (j = (1); j <= (q); ++j) {
    if (ans[j].first == 0 && ans[j].second == 0) continue;
    if (query(1, 1, n, ans[j].first, ans[j].second) < j) return false;
  }
  return true;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> q;
  a.clear();
  a.reserve(n + 1);
  bool fl = true;
  long long int zP = 0;
  m = 0;
  a.push_back(0);
  for (i = 0; i < (n); ++i) {
    cin >> in;
    a.push_back(in);
    if (in > m) m = in;
    if (in == 0) {
      m = q;
      zP = i + 1;
      continue;
    }
    insert(1, 1, n, i + 1, in);
    if (in == q) fl = false;
    if (ans[in].first == 0) ans[in].first = i + 1;
    if (ans[in].second <= i) ans[in].second = i + 1;
  }
  if (m != q || check() == false) {
    cout << "NO";
    return 0;
  }
  if (fl) {
    if (zP)
      a[zP] = q;
    else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES"
       << "\n";
  long long int pvr = 0;
  for (i = (1); i <= (n); ++i)
    if (a[i]) {
      pvr = a[i];
      break;
    }
  for (i = (1); i <= (n); ++i) {
    cout << (a[i] ? (pvr = a[i]) : pvr) << " ";
  }
  aryanc403();
  return 0;
}
