#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long arr[N], start[N], finish[N], tree[4 * N];
class DArrayRestoration {
 public:
  void build(long long node, long long start, long long end) {
    if (start == end) {
      tree[node] = arr[start];
      return;
    }
    long long mid = (start + end) >> 1;
    build(2 * node, start, mid);
    build(2 * node + 1, mid + 1, end);
    tree[node] = min(tree[2 * node], tree[2 * node + 1]);
  }
  long long query(long long node, long long start, long long end, long long l,
                  long long r) {
    if (start > end or start > r or end < l) return INT_MAX;
    if (start >= l and end <= r) return tree[node];
    long long mid = (start + end) >> 1;
    return min(query(2 * node, start, mid, l, r),
               query(2 * node + 1, mid + 1, end, l, r));
  }
  void solve(std::istream& in, std::ostream& out) {
    long long n, q;
    in >> n >> q;
    memset(start, 0, sizeof start);
    for (long long i = 1; i <= n; i++) {
      in >> arr[i];
      if (!start[arr[i]])
        start[arr[i]] = finish[arr[i]] = i;
      else
        finish[arr[i]] = i;
      if (!arr[i]) arr[i] = INT_MAX;
    }
    build(1, 1, n);
    for (long long i = 1; i <= q; i++) {
      if (!start[i]) continue;
      long long mi = query(1, 1, n, start[i], finish[i]);
      if (mi < i) {
        out << "NO";
        return;
      }
    }
    if (!start[0] and !start[q]) {
      out << "NO";
      return;
    }
    out << "YES\n";
    if (!start[q]) arr[start[0]] = q;
    arr[0] = 1;
    for (long long i = 1; i <= n; i++) {
      if (arr[i] == INT_MAX) arr[i] = arr[i - 1];
      out << arr[i] << ' ';
    }
  }
};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  DArrayRestoration solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
