#include <bits/stdc++.h>
using namespace std;
int Array[200005], SegTree[800005], MAX = 1e9;
pair<int, int> Queries[200005];
void Build(int Node, int low, int high) {
  if (low == high) {
    if (Array[low] == 0)
      SegTree[Node] = MAX;
    else
      SegTree[Node] = Array[low];
  } else {
    int middle = (low + high) >> 1;
    int Temp = Node << 1;
    Build(Temp, low, middle);
    Build(Temp + 1, middle + 1, high);
    SegTree[Node] = min(SegTree[Temp], SegTree[Temp + 1]);
  }
}
int query(int Node, int low, int high, int start, int end) {
  if (end < low || start > high)
    return MAX;
  else if (start <= low && end >= high)
    return SegTree[Node];
  else {
    int middle = (low + high) >> 1;
    int Temp = Node << 1;
    return min(query(Temp, low, middle, start, end),
               query(Temp + 1, middle + 1, high, start, end));
  }
}
int main() {
  int N, q, i;
  bool Found = false, zero = false;
  scanf("%d%d", &N, &q);
  for (i = 1; i <= q; ++i) {
    Queries[i].first = MAX;
    Queries[i].second = 0;
  }
  for (i = 1; i <= N; ++i) {
    scanf("%d", Array + i);
    if (Array[i] == 0) {
      zero = true;
      continue;
    }
    Queries[Array[i]].first = min(Queries[Array[i]].first, i);
    Queries[Array[i]].second = max(Queries[Array[i]].second, i);
    if (Array[i] == q) Found = true;
  }
  if (Found == false && zero == false) {
    puts("NO");
    return 0;
  }
  Build(1, 1, N);
  int value;
  for (i = 1; i <= q; ++i) {
    if (Queries[i].first == MAX) continue;
    value = query(1, 1, N, Queries[i].first, Queries[i].second);
    if (value < i) {
      puts("NO");
      return 0;
    }
  }
  if (Found == false) {
    for (i = 1; i <= N; ++i) {
      if (Array[i] == 0) break;
    }
    while (i <= N && Array[i] == 0) {
      Array[i] = q;
      ++i;
    }
  }
  int j, start, end, x = 1;
  if (Array[1] == 0) {
    for (i = 1; i <= N; ++i) {
      if (Array[i] != 0) break;
    }
    x = i;
    if (x > N) {
      puts("YES");
      for (i = 1; i <= N; ++i) printf("%d ", q);
      puts("");
      return 0;
    } else {
      for (j = 1; j < x; ++j) Array[j] = Array[x];
    }
  }
  for (i = x; i <= N;) {
    j = i;
    while (j <= N && Array[j] != 0) {
      ++j;
    }
    if (j > N) break;
    start = j - 1;
    while (j <= N && Array[j] == 0) {
      ++j;
    }
    if (j > N) {
      for (j = start + 1; j <= N; ++j) {
        Array[j] = Array[start];
      }
      break;
    }
    end = j;
    int Num = max(Array[start], Array[end]);
    for (j = start + 1; j < end; ++j) Array[j] = Num;
    i = j;
  }
  puts("YES");
  for (i = 1; i <= N; ++i) printf("%d ", Array[i]);
  puts("");
  return 0;
}
