func_code_string: #include <bits/stdc++.h>   using namespace std;   void read_file(bool outToFile = true) {}   int n, K;   const int MAXN = 200000 + 99;   int A[MAXN];   set<int> X;   int vis[MAXN];   bool check() {     memset(vis, 0, sizeof vis);     stack<int> s;     int idx = 0;     int cur = 1;     while (true) {       while (s.empty() || s.top() != cur) {         s.push(A[idx]);         vis[A[idx]] = 1;         idx++;       }       s.pop();       cur++;       if (cur == n + 1) break;       if (vis[cur] && cur != s.top()) return false;     }     return true;   }   int main() {     read_file();     while (scanf( %d%d , &n, &K) != -1) {       X.clear();       memset(vis, 0, sizeof vis);       for (int i = 0; i < K; i++) {         scanf( %d , &A[i]);         if (A[i] != 1) X.insert(A[i] - 1);         vis[A[i]] = 1;       }       for (int i = 0; i < K; i++) {         if (X.count(A[i])) X.erase(A[i]);       }       int idx = K;       while (!X.empty()) {         int x = *X.begin();         X.erase(X.begin());         A[idx++] = x;         vis[x] = 1;         if (x == 1) continue;         if (!vis[x - 1]) X.insert(x - 1);       }       int mx = 0;       for (int i = 0; i < idx; i++) mx = max(mx, A[i]);       for (int i = n; i > mx; i--) A[idx + n - i] = i;       if (!check()) {         printf( -1 n );         continue;       }       for (int i = 0; i < n; i++) printf( %d%c , A[i],    n [i == n - 1]);     }   }   