#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[200007], l[200007], r[200007], b[200007];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (l[a[i]] == 0) l[a[i]] = i;
    r[a[i]] = i;
    b[i] = a[i];
  }
  for (int i = 1; i <= q; i++) {
    if (l[i] == 0) continue;
    for (int j = l[i]; j <= r[i]; j++) {
      if (a[j] == 0)
        a[j] = i;
      else if (a[j] < i)
        return cout << "NO", 0;
      else if (a[j] > i) {
        if (r[a[j]] > r[i]) return cout << "NO", 0;
        j = r[a[j]];
      }
    }
  }
  if (l[q] == 0) {
    bool ok = 0;
    for (int i = 1; i <= n; i++) {
      if (b[i] == 0) {
        ok = 1;
        a[i] = q;
        break;
      }
    }
    if (!ok) return cout << "NO", 0;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      if (a[i - 1] != 0)
        a[i] = a[i - 1];
      else if (a[i + 1] != 0)
        a[i] = a[i + 1];
    }
  }
  for (int i = n; i >= 1; i--) {
    if (a[i] == 0) {
      if (a[i - 1] != 0)
        a[i] = a[i - 1];
      else if (a[i + 1] != 0)
        a[i] = a[i + 1];
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
