#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long arr[N], start[N], finish[N];
class segmentTree {
 public:
  long long n;
  vector<long long> tree, lazy, arr;
  segmentTree(long long n) {
    this->n = n + 1;
    tree = vector<long long>(4 * n, 0);
    lazy = vector<long long>(4 * n, 0);
  }
  long long query(long long node, long long start, long long end, long long l,
                  long long r) {
    if (lazy[node]) {
      tree[node] = lazy[node];
      if (start != end) {
        lazy[2 * node] = lazy[node];
        lazy[2 * node + 1] = lazy[node];
      }
      lazy[node] = 0;
    }
    if (start > end or end < l or start > r) return -1;
    if (start >= l and end <= r) return tree[node];
    long long mid = (start + end) >> 1;
    return max(query(2 * node, start, mid, l, r),
               query(2 * node + 1, mid + 1, end, l, r));
  }
  void update(long long node, long long start, long long end, long long l,
              long long r, long long val) {
    if (lazy[node]) {
      tree[node] = lazy[node];
      if (start != end) {
        lazy[2 * node] = lazy[node];
        lazy[2 * node + 1] = lazy[node];
      }
      lazy[node] = 0;
    }
    if (start > end or end < l or start > r) return;
    if (start >= l and end <= r) {
      tree[node] = val;
      if (start != end) {
        lazy[2 * node] = val;
        lazy[2 * node + 1] = val;
      }
      return;
    }
    long long mid = (start + end) >> 1;
    update(2 * node, start, mid, l, r, val);
    update(2 * node + 1, mid + 1, end, l, r, val);
    tree[node] = max(tree[2 * node], tree[2 * node + 1]);
  }
  void updateUtil(long long l, long long r, long long val) {
    update(1, 1, n, l, r, val);
  }
  long long queryUtil(long long l, long long r) { return query(1, 1, n, l, r); }
};
class DArrayRestoration {
 public:
  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;
    }
    segmentTree st1(n + 1);
    for (long long i = 1; i <= q; i++) {
      if (!start[i]) continue;
      st1.updateUtil(start[i], finish[i], i);
    }
    for (long long i = 1; i <= n; i++) {
      if (!arr[i]) continue;
      long long x = st1.queryUtil(i, i);
      if (x != arr[i]) {
        out << "NO";
        return;
      }
    }
    if (!start[0] and st1.queryUtil(1, n) != q) {
      out << "NO";
      return;
    }
    out << "YES\n";
    arr[0] = 1;
    if (st1.queryUtil(1, n) != q) arr[start[0]] = q;
    for (long long i = 1; i <= n; i++) {
      if (arr[i])
        out << arr[i] << ' ';
      else
        out << (arr[i] = arr[i - 1]) << ' ';
    }
  }
};
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;
}
