#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool isLeap(T y) {
  return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false);
}
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
template <class T>
inline T BigMod(T Base, T power, T M = 1000000007) {
  if (power == 0) return 1;
  if (power & 1)
    return ((Base % M) * (BigMod(Base, power - 1, M) % M)) % M;
  else {
    T y = BigMod(Base, power / 2, M) % M;
    return (y * y) % M;
  }
}
template <class T>
inline T ModInv(T A, T M = 1000000007) {
  return BigMod(A, M - 2, M);
}
int fx[] = {-1, +0, +1, +0, +1, +1, -1, -1, +0};
int fy[] = {+0, -1, +0, +1, +1, -1, +1, -1, +0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int cover[300005], first[300005], last[300005], arr[300005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  memset(first, -1, sizeof(first));
  memset(last, -1, sizeof(last));
  memset(cover, -1, sizeof(cover));
  int pt = 0;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 0) {
      pt++;
      v.push_back(i);
    }
    if (first[arr[i]] == -1) {
      first[arr[i]] = i;
    }
    last[arr[i]] = i;
  }
  if (first[q] == -1 && pt == 0) {
    cout << "NO";
    return 0;
  }
  if (first[q] == -1) {
    arr[v[v.size() - 1]] = q;
    first[q] = v[v.size() - 1];
    last[q] = v[v.size() - 1];
  }
  if (pt == n) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << q << " ";
    return 0;
  }
  for (int i = q; i >= 1; i--) {
    for (int j = first[i]; j <= last[i]; j++) {
      if (arr[j] == 0) arr[j] = i;
      if (arr[j] < i) {
        cout << "NO";
        return 0;
      }
      if (cover[j] != -1) {
        j = cover[j] + 1;
      } else
        cover[j] = last[i];
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    if (arr[i] != 0) {
      for (int j = i - 1; j >= 0; j--) {
        if (arr[j] != 0)
          break;
        else
          arr[j] = arr[i];
      }
      for (int j = i + 1; j < n; j++) {
        if (arr[j] != 0)
          break;
        else
          arr[j] = arr[i];
      }
    }
  }
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  return 0;
}
