func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 5;   int lazy[maxn << 2];   int a[maxn], c[maxn];   void pushup(int l, int r, int rt) {     lazy[rt << 1] = lazy[rt << 1 | 1] = lazy[rt];     lazy[rt] = 0;   }   void update(int L, int R, int c, int l, int r, int rt) {     if (L <= l && R >= r) {       lazy[rt] = c;       return;     }     if (lazy[rt]) pushup(l, r, rt);     if (L <= ((l + r) >> 1)) update(L, R, c, l, ((l + r) >> 1), rt << 1);     if (R > ((l + r) >> 1)) update(L, R, c, ((l + r) >> 1) + 1, r, rt << 1 | 1);   }   void query(int l, int r, int rt) {     if (l == r) {       c[l] = lazy[rt];       return;     }     if (lazy[rt]) pushup(l, r, rt);     query(l, ((l + r) >> 1), rt << 1);     query(((l + r) >> 1) + 1, r, rt << 1 | 1);   }   struct T {     int l, r;   } b[maxn];   int main() {     map<int, int> mp;     int n, k;     cin >> n >> k;     for (int i = 1; i <= n; i++) cin >> a[i];     for (int i = 1; i <= n; i++) {       if (a[i] == 0) continue;       if (mp[a[i]])         b[a[i]].r = i;       else         mp[a[i]] = 1, b[a[i]].l = i, b[a[i]].r = i;     }     for (int i = 1; i <= k; i++) {       if (mp[i]) {         update(b[i].l, b[i].r, i, 1, n, 1);       }     }     query(1, n, 1);     bool d = true;     for (int i = 1; i <= n; i++) {       if (c[i] != a[i] && a[i] != 0) d = false;     }     if (!d) {       cout <<  NO  << endl;       return 0;     }     bool ff = true;     for (int i = 1; i <= n; i++) {       if (a[i] == k) ff = false;     }     if (ff) {       bool dd = false;       for (int i = 1; i <= n; i++)         if (a[i] == 0) {           dd = true;           c[i] = k;           break;         }       if (!dd) {         cout <<  NO  << endl;         return 0;       }     }     cout <<  YES  << endl;     for (int i = 1; i <= n; i++) {       if (a[i] == 0 && c[i] == 0) {         c[i] = 1;       }       cout << c[i] <<    ;     }     cout << endl;   }   