#include <bits/stdc++.h>
using namespace std;
const int N = 421543;
const int M = 26543;
const int INF = 1023456789;
int n, m, k, start, goal;
int a[N], c[N];
char s[N];
vector<int> b[N];
inline int lowbit(int x) { return x & (-x); }
inline void add(int x) {
  while (x <= n + 1) {
    ++c[x];
    x += lowbit(x);
  }
}
int ask(int x) {
  int ret = 0;
  while (x > 0) {
    ret += c[x];
    x -= lowbit(x);
  }
  return ret;
}
int main() {
  int cases = 1;
  for (int iii = 1; iii <= cases; ++iii) {
    scanf("%d%d", &n, &m);
    bool maxi = false, zero = false;
    int hea = -1;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
      if (a[i] == 0) zero = true;
      if (a[i] == m) maxi = true;
      if (a[i] && hea == -1) hea = a[i];
    }
    if (!maxi && !zero) {
      printf("NO\n");
      continue;
    }
    if (hea == -1) {
      printf("YES\n");
      for (int i = 0; i < n; ++i) {
        printf("%d", m);
        if (i < n - 1)
          printf(" ");
        else
          printf("\n");
      }
      continue;
    }
    bool firs = true;
    for (int i = 0; i < n; ++i) {
      if (a[i]) continue;
      if (firs) {
        firs = false;
        if (!maxi)
          a[i] = m;
        else if (i == 0)
          a[i] = hea;
        else
          a[i] = a[i - 1];
      } else
        a[i] = a[i - 1];
    }
    for (int i = 0; i < n; ++i) {
      b[a[i]].push_back(i);
    }
    bool ok = true;
    for (int i = 1; i <= m; ++i) {
      if (b[i].size() == 0) continue;
      int len = b[i].size();
      if (ask(b[i][len - 1] + 1) - ask(b[i][0] + 1)) {
        ok = false;
        break;
      }
      for (int j = 0; j < len; ++j) add(b[i][j] + 1);
    }
    if (!ok)
      printf("NO\n");
    else {
      printf("YES\n");
      for (int i = 0; i < n; ++i) {
        printf("%d", a[i]);
        if (i < n - 1)
          printf(" ");
        else
          printf("\n");
      }
    }
  }
}
