#include <bits/stdc++.h>
using namespace std;
const int max_N = 2e5 + 10;
int bit[max_N];
void update(int p, int x) {
  for (; p < max_N; p += (p & -p)) {
    bit[p] += x;
  }
}
int query(int p) {
  int ans = 0;
  for (; p > 0; p -= (p & -p)) {
    ans += bit[p];
  }
  return ans;
}
int query(int L, int R) { return query(R) - query(L - 1); }
void fail() {
  cout << "NO" << endl;
  exit(0);
}
vector<int> occ[max_N];
int a[max_N];
int main() {
  int N, Q;
  cin >> N >> Q;
  for (int i = 1; i <= N; ++i) {
    int x;
    cin >> x;
    a[i] = x;
    occ[x].push_back(i);
  }
  for (int i = 1; i <= Q; ++i) {
    sort(occ[i].begin(), occ[i].end());
  }
  for (auto &i : occ[0]) {
    update(i, 1);
  }
  for (int i = Q; i >= 1; --i) {
    if (occ[i].empty()) {
      continue;
    }
    for (auto &j : occ[i]) {
      update(j, 1);
    }
    int L = occ[i].front(), R = occ[i].back();
    if (R - L + 1 != query(L, R)) {
      fail();
    }
  }
  bool foundQ = false;
  for (int i = 1; i <= N; ++i) {
    if (a[i] == Q) {
      foundQ = true;
    }
  }
  if (!foundQ) {
    for (int i = 1; i <= N; ++i) {
      if (a[i] == 0) {
        a[i] = Q;
        foundQ = true;
        break;
      }
    }
  }
  if (!foundQ) {
    fail();
  }
  int def = -1;
  for (int i = 1; i <= N; ++i) {
    if (a[i] != 0) {
      def = a[i];
    } else if (def != -1) {
      a[i] = def;
    }
  }
  def = -1;
  for (int i = N; i >= 1; --i) {
    if (a[i] != 0) {
      def = a[i];
    } else if (def != -1) {
      a[i] = def;
    }
  }
  if (!foundQ) {
    fail();
  }
  cout << "YES" << endl;
  for (int i = 1; i <= N; ++i) {
    cout << a[i] << ' ';
  }
  cout << endl;
}
