#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!(ch >= '0' && ch <= '9')) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * f;
}
const int N = 200005;
int n, q, a[N];
int ans[N];
int last[N], nxt[N];
long long sum[N];
int tmp[N << 2];
inline void ins(int x, int val) {
  while (x <= n) {
    sum[x] += val;
    x += x & -x;
  }
}
inline long long query(int x) {
  long long ret = 0;
  while (x) {
    ret += sum[x];
    x -= x & -x;
  }
  return ret;
}
inline void cover(int x, int l, int r, int ll, int rr, int val) {
  if (l > rr || r < ll) return;
  if (l >= ll && r <= rr) {
    tmp[x] = max(tmp[x], val);
    return;
  }
  int mid = (l + r) >> 1;
  cover(x << 1, l, mid, ll, rr, val);
  cover(x << 1 | 1, mid + 1, r, ll, rr, val);
}
inline void getans(int x, int l, int r, int val) {
  val = max(val, tmp[x]);
  if (l == r) {
    ans[l] = val;
    return;
  }
  int mid = (l + r) >> 1;
  getans(x << 1, l, mid, val);
  getans(x << 1 | 1, mid + 1, r, val);
}
vector<int> pos[N];
int top = 0, stk[N];
inline bool check() {
  for (int step = (q); step >= (1); step--) {
    if (pos[step].size() == 0) continue;
    ins(pos[step][0], -step);
    for (int i = 1; i < (int)pos[step].size(); i++) {
      if (query(pos[step][i] - 1) - query(pos[step][i - 1]) == 0)
        ins(pos[step][i], -step);
      else
        return 0;
    }
    cover(1, 1, n, pos[step][0], pos[step][pos[step].size() - 1], step);
  }
  getans(1, 1, n, 0);
  bool flag;
  if (pos[q].size() == 0)
    flag = 0;
  else
    flag = 1;
  for (int i = (1); i <= (n); i++) {
    if (!ans[i]) {
      if (!flag)
        ans[i] = q, flag = 1;
      else
        ans[i] = 1;
    }
  }
  if (!flag)
    for (int i = (1); i <= (n); i++)
      if (!a[i]) {
        flag = 1;
        ans[i] = q;
        break;
      }
  return flag;
}
int main() {
  n = read(), q = read();
  for (int i = (1); i <= (n); i++) {
    a[i] = read();
    if (a[i]) pos[a[i]].push_back(i);
    ins(i, a[i]);
  }
  if (!check())
    puts("NO");
  else {
    puts("YES");
    for (int i = (1); i <= (n - 1); i++) printf("%d ", ans[i]);
    printf("%d\n", ans[n]);
  }
  return 0;
}
