#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long INFLL = 1e18 + 1;
const int MAX = 200001;
const long long MOD = 1000000007;
long long inq(long long k, long long q) {
  if (q == 0) return 1;
  long long l = inq(k, q / 2);
  if (q % 2 == 0)
    return l * l % MOD;
  else
    return l * l * k % MOD;
}
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long cubr(long long a) {
  long long l = -1, r = 1e6 + 2;
  while (l < r - 1) {
    long long mid = (l + r) / 2;
    if (mid * mid * mid > a)
      r = mid;
    else
      l = mid;
  }
  return l;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) { return -1 * max(-a, -b); }
long long possible(long long q) {
  if (q == INF) return -1;
  return q;
}
bool correct(int x, int xx) {
  if (x < 0) return 0;
  if (x >= xx) return 0;
  return 1;
}
long long dsumm(long long x, long long k) {
  long long y = 1;
  long long z = 0;
  for (int i = 0; y < 1e18; i++) {
    z += x / y % k;
    y *= k;
  }
  return z;
}
long long dcount(long long x) {
  long long y = 1;
  long long z = 0;
  int c[100];
  for (int i = 0; i < 10; i++) c[i] = 0;
  for (int i = 0; x > 0; i++) {
    if (c[x / y % 10] == 0) z++;
    c[x / y % 10] = 1;
    x /= 10;
  }
  return z;
}
long long lg10(long long x) {
  if (x == 0) return 0;
  return lg10(x / 10) + 1;
}
string months[12] = {"January",   "February", "March",    "April",
                     "May",       "June",     "July",     "August",
                     "September", "October",  "November", "December"};
int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
vector<int> cx, cy;
long long n, q, non_zero, is_zero = -1, is_q = -1;
long long a[500000];
vector<long long> b[500000];
long long c[500000];
long long frst[500000];
long long last[500000];
int main() {
  fill(frst, frst + 500000, INF);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) non_zero = 1;
    if (a[i] == 0) is_zero = i;
    frst[a[i]] = min(frst[a[i]], i);
    last[a[i]] = max(last[a[i]], i);
  }
  if (non_zero == 0) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      printf("%lld ", q);
    }
    return 0;
  }
  for (int i = 1; i <= q; i++) {
    long long start = frst[i];
    long long end1 = last[i];
    if (start == INF) {
      continue;
    } else {
      b[start].push_back(i);
      b[end1].push_back(-i);
    }
  }
  set<int> num;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < b[i].size(); j++) {
      if (b[i][j] > 0) {
        num.insert(b[i][j]);
      }
    }
    if (num.size() == 0) continue;
    auto it = num.end();
    it--;
    long long kk = *it;
    c[i] = kk;
    for (int j = b[i].size() - 1; j >= 0; j--) {
      if (b[i][j] < 0) {
        if (num.size() == 0) {
          cout << "NO\n";
          return 0;
          ;
        }
        if (num.find(-b[i][j]) == num.end()) {
          cout << "NO\n";
          return 0;
          ;
        } else {
          num.erase(-b[i][j]);
        }
      }
    }
  }
  int lst = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] == 0) {
      c[i] = lst;
    } else {
      lst = c[i];
    }
  }
  lst = 0;
  for (int i = n; i >= 0; i--) {
    if (c[i] == 0) {
      c[i] = lst;
    } else {
      lst = c[i];
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != c[i] && a[i] != 0) {
      cout << "NO\n";
      return 0;
      ;
    }
    if (c[i] == q) {
      is_q = i;
    }
  }
  if (is_q == -1 && is_zero == -1) {
    cout << "NO\n";
    return 0;
    ;
  }
  if (is_q == -1 && is_zero != -1) {
    c[is_zero] = q;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    printf("%lld ", c[i]);
  }
}
