#include <bits/stdc++.h>
using namespace std;
int n, q, t[800005], foo;
int v[200005], yi[200005], hou[200005];
bool has_q, has_z;
void build(int pos, int l, int r) {
  if (l == r) {
    if (v[l] == 0)
      t[pos] = q;
    else
      t[pos] = v[l];
  } else {
    build(pos * 2 + 1, l, (l + r) / 2);
    build(pos * 2 + 2, (l + r) / 2 + 1, r);
    t[pos] = min(t[pos * 2 + 1], t[pos * 2 + 2]);
  }
}
int get(int pos, int l, int r, int b, int e) {
  if (b > r || e < l) return INT_MAX;
  if (b >= l && e <= r) return t[pos];
  int c = get(pos * 2 + 1, l, r, b, (b + e) / 2);
  int d = get(pos * 2 + 2, l, r, (b + e) / 2 + 1, e);
  return min(c, d);
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &v[i]);
    if (v[i] == q)
      has_q = true;
    else if (v[i] == 0)
      has_z = true, foo = i;
  }
  build(0, 0, n - 1);
  memset(yi, -1, sizeof yi);
  for (int i = 0; i < n; ++i) {
    if (yi[v[i]] == -1) yi[v[i]] = i;
    hou[v[i]] = i;
  }
  for (int i = 1; i <= q; ++i) {
    if (yi[i] != -1) {
      int x = get(0, yi[i], hou[i], 0, n - 1);
      if (x < i) {
        puts("NO");
        return 0;
      }
    }
  }
  if (!has_q && !has_z)
    puts("NO");
  else {
    for (int i = 0; i < n; ++i) {
      if (v[i] == 0) {
        if (i == foo && !has_q) v[i] = q;
        for (int j = i; j < n; ++j) {
          if (v[j] != 0) {
            for (int k = j - 1; k >= 0; --k) {
              if (v[k] == 0)
                v[k] = v[j];
              else {
                i = j - 1;
                break;
              }
            }
            break;
          } else if (j == foo && !has_q) {
            for (int k = j; k >= 0; --k) {
              if (v[k] == 0)
                v[k] = q;
              else
                break;
            }
          }
        }
      } else {
        if (i + 1 < n && v[i + 1] == 0) {
          for (int j = i + 1; j < n; ++j) {
            if (v[j] == 0) {
              if (j == foo && !has_q)
                v[j] = q;
              else
                v[j] = v[i];
            } else {
              i = j - 1;
              break;
            }
          }
        }
      }
    }
    puts("YES");
    for (int i = 0; i < n; ++i) printf("%d ", v[i]);
    puts("");
  }
  return 0;
}
