func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, q;   int a[200010];   int last[200010];   int x = -1, y = -1, z = -1;   stack<int> t;   int main() {     scanf( %d%d , &n, &q);     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       if (a[i] == 0) {         z = i;         if (i) a[i] = a[i - 1];       } else {         if (x == -1) x = i;         if (a[i] == q) y = i;       }     }     if (x == -1) {       cout <<  YES  << endl;       for (int i = 0; i < n; i++) cout << q <<    ;       return 0;     }     for (int i = x - 1; i >= 0; i--) a[i] = a[i + 1];     if (y == -1) {       if (z == -1) {         cout <<  NO  << endl;         return 0;       }       a[z] = q;     }     for (int i = 0; i < n; i++) last[a[i]] = i;     for (int i = 0; i < n; i++) {       if (!t.empty() && t.top() > a[i]) {         cout <<  NO  << endl;         return 0;       } else if (t.empty() || t.top() < a[i])         t.push(a[i]);       if (last[a[i]] == i) t.pop();     }     cout <<  YES  << endl;     for (int i = 0; i < n; i++) cout << a[i] <<    ;     return 0;   }   