#include <bits/stdc++.h>
using namespace std;
int tree[2000002] = {0}, a[200002];
void build(int node, int start, int end) {
  if (start == end) {
    tree[node] = a[start];
  } else {
    int mid = (start + end) / 2;
    build(2 * node, start, mid);
    build(2 * node + 1, mid + 1, end);
    tree[node] = min(tree[2 * node], tree[2 * node + 1]);
  }
}
int query(int node, int start, int end, int l, int r) {
  if (r < start or end < l) {
    return 1000000000;
  }
  if (l <= start and end <= r) {
    return tree[node];
  }
  int mid = (start + end) / 2;
  int p1 = query(2 * node, start, mid, l, r);
  int p2 = query(2 * node + 1, mid + 1, end, l, r);
  return min(p1, p2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    int i, j, k, l, n, q, flag = 0;
    cin >> n >> q;
    pair<int, int> b[q + 1];
    for (i = 0; i <= q; i++) b[i] = make_pair(-1, -1);
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] > q) {
        flag = 1;
        continue;
      }
      if (flag != 1 && a[i] == q) flag = 2;
      if (a[i] != 0) {
        if (b[a[i]].first == -1)
          b[a[i]] = make_pair(i, i);
        else
          b[a[i]] = make_pair(b[a[i]].first, i);
      }
      if (a[i] == 0) a[i] = INT_MAX;
    }
    if (flag == 1) {
      cout << "NO\n";
      return 0;
    }
    if (flag != 2) {
      for (i = 1; i <= n; i++)
        if (a[i] == INT_MAX) {
          a[i] = q;
          flag = 3;
          break;
        }
      if (flag != 3) {
        cout << "NO" << endl;
        return 0;
      }
    }
    build(1, 1, n);
    for (i = q; i >= 1; i--) {
      if (b[i].first == -1) continue;
      j = query(1, 1, n, b[i].first, b[i].second);
      if (j != i) {
        flag = -1;
      }
    }
    if (flag == -1) {
      cout << "NO" << endl;
      return 0;
    }
    cout << "YES\n";
    for (i = 1; i <= n; i++) {
      if (a[i] == INT_MAX) {
        if (i == 1)
          a[i] = 1;
        else
          a[i] = a[i - 1];
      }
      cout << a[i] << " ";
    }
    cout << endl;
  }
}
