#include <bits/stdc++.h>
using namespace std;
struct SegmentTree {
 private:
  int n;
  vector<int> lo, hi, tree, delta;
  void init(int i, int a, int b) {
    lo[i] = a;
    hi[i] = b;
    if (a == b) {
      return;
    }
    int m = (a + b) / 2;
    init(2 * i, a, m);
    init(2 * i + 1, m + 1, b);
  }
  void prop(int i) {
    delta[2 * i] += delta[i];
    delta[2 * i + 1] += delta[i];
    delta[i] = 0;
  }
  void update(int i) {
    tree[i] =
        min(tree[2 * i] + delta[2 * i], tree[2 * i + 1] + delta[2 * i + 1]);
  }
  void add(int i, int a, int b, int val) {
    if (b < lo[i] || a > hi[i]) return;
    if (a <= lo[i] && hi[i] <= b) {
      delta[i] += val;
      return;
    }
    prop(i);
    add(2 * i, a, b, val);
    add(2 * i + 1, a, b, val);
    update(i);
  }
  int query(int i, int a, int b) {
    if (b < lo[i] || a > hi[i]) return INT_MAX;
    if (a <= lo[i] && hi[i] <= b) {
      return tree[i] + delta[i];
    }
    prop(i);
    int treeLeft = query(2 * i, a, b);
    int treeRight = query(2 * i + 1, a, b);
    update(i);
    return min(treeLeft, treeRight);
  }

 public:
  SegmentTree(int N) {
    n = N;
    lo = vector<int>(4 * N + 1);
    hi = vector<int>(4 * N + 1);
    tree = vector<int>(4 * N + 1);
    delta = vector<int>(4 * N + 1);
    init(1, 0, n - 1);
  }
  void add(int a, int b, int val) { add(1, a, b, val); }
  int query(int a, int b) { return query(1, a, b); }
};
int A[200005], lo[200005], hi[200005];
bool vis[200005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, q;
  cin >> n >> q;
  SegmentTree t(n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    vis[A[i]] = true;
    if (A[i] == q) cnt++;
  }
  bool f = true;
  if (cnt == 0) f = false;
  for (int i = 0; i < n; i++) {
    if (A[i] == 0) {
      if (f == false)
        A[i] = q, f = true;
      else
        A[i] = q + 1;
    }
    t.add(i, i, A[i]);
  }
  if (f == false) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) hi[A[i]] = i;
  for (int i = n - 1; i >= 0; i--) lo[A[i]] = i;
  for (int i = 1; i <= q; i++) {
    if (vis[i] == false) continue;
    int mn = t.query(lo[i], hi[i]);
    if (mn != i) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = 1; i < n; i++) {
    if (A[i] == q + 1) {
      if (A[i - 1] != q + 1) A[i] = A[i - 1];
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    if (A[i] == q + 1) {
      if (A[i + 1] != q + 1) A[i] = A[i + 1];
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << A[i] << " ";
  cout << endl;
}
