func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   int n, q, a[N], node[4 * N];   vector<int> pos[N];   void init(int i, int l, int r) {     if (l == r) {       node[i] = (a[l] == 0 ? 1e9 : a[l]);       return;     }     int m = (l + r) >> 1;     init(i << 1, l, m);     init(i << 1 | 1, m + 1, r);     node[i] = min(node[i << 1], node[i << 1 | 1]);   }   int get(int i, int l, int r, int a, int b) {     if (l > r || a > r || b < l) return (int)1e9;     if (a <= l && r <= b) return node[i];     int m = (l + r) >> 1;     return min(get(i << 1, l, m, a, b), get(i << 1 | 1, m + 1, r, a, b));   }   int main() {     scanf( %d %d , &n, &q);     bool f = false;     bool zero = false;     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       if (a[i] == q) f = true;       if (a[i])         pos[a[i]].push_back(i);       else         zero = true;     }     if (!f && !zero) return !printf( NO );     init(1, 1, n);     for (int i = 1; i <= q; i++) {       if (pos[i].size() > 0) {         if (get(1, 1, n, pos[i][0], pos[i][pos[i].size() - 1]) < i)           return !printf( NO );       }     }     puts( YES );     int l = 1;     while (l <= n) {       while (l <= n && a[l]) l++;       int r = l;       while (r <= n && !a[r]) r++;       if (l > 1) {         for (int j = l; j < r; j++) a[j] = f ? a[l - 1] : q;         if (!f) f = true;       } else if (r <= n) {         for (int j = l; j < r; j++) a[j] = f ? a[r] : q;         if (!f) f = true;       } else         for (int j = l; j < r; j++) a[j] = q;       l = r;     }     for (int i = 1; i <= n; i++) printf( %d  , a[i]);     return 0;   }   