#include <bits/stdc++.h>
using namespace std;
struct Interval {
  long long x;
  long long s, e;
};
bool cmp1(Interval i1, Interval i2) { return i1.s < i2.s; }
bool cmp2(Interval i1, Interval i2) { return i1.e < i2.e; }
class Cmp {
 public:
  bool operator()(const Interval& a, const Interval& b) { return a.x < b.x; }
};
int main() {
  long long n, q;
  cin >> n >> q;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<Interval> in(q + 1);
  for (long long i = 1; i < q + 1; i++) {
    in[i].x = i;
    in[i].s = -1;
    in[i].e = -1;
  }
  vector<Interval> ins;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
    if (a[i] != 0) {
      if (in[a[i]].s == -1) {
        in[a[i]].s = i;
      }
      in[a[i]].e = i;
    }
  }
  bool all = true;
  for (long long i = 0; i < n; i++) {
    if (a[i] != 0) {
      all = false;
      break;
    }
  }
  if (all) {
    cout << "YES\n";
    for (long long i = 0; i < n; i++) {
      cout << q << " ";
    }
    return 0;
  }
  for (long long i = 1; i < q + 1; i++) {
    if (in[i].s != -1) {
      ins.push_back(in[i]);
    }
  }
  vector<Interval> ins1 = ins;
  vector<Interval> ins2 = ins;
  sort(ins1.begin(), ins1.end(), cmp1);
  sort(ins2.begin(), ins2.end(), cmp2);
  priority_queue<Interval, vector<Interval>, Cmp> mxh, del;
  long long ss = 0, ee = 0;
  for (long long i = 0; i < n; i++) {
    while (ss < ins1.size() && ins1[ss].s == i) {
      mxh.push(ins1[ss]);
      ++ss;
    }
    if (!mxh.empty()) {
      Interval in = mxh.top();
      if (b[i] == 0) {
        b[i] = in.x;
      } else {
        if (b[i] != in.x) {
          cout << "NO";
          return 0;
        }
      }
    }
    while (ee < ins2.size() && ins2[ee].e == i) {
      del.push(ins2[ee]);
      ++ee;
    }
    while (!mxh.empty() && !del.empty() && mxh.top().x == del.top().x) {
      mxh.pop();
      del.pop();
    }
  }
  for (long long i = 1; i < n; i++) {
    if (b[i] == 0) {
      if (b[i - 1] != 0) {
        b[i] = b[i - 1];
      }
    }
  }
  for (long long i = n - 2; i > -1; i--) {
    if (b[i] == 0) {
      if (b[i + 1] != 0) {
        b[i] = b[i + 1];
      }
    }
  }
  bool atleast = false;
  for (long long i = 0; i < n; i++) {
    if (b[i] == q) {
      atleast = true;
      break;
    }
  }
  if (!atleast) {
    for (long long i = 0; i < n; i++) {
      if (a[i] == 0) {
        b[i] = q;
        atleast = true;
        break;
      }
    }
  }
  if (!atleast) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (long long i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
  return 0;
}
