func_code_string: #include <bits/stdc++.h>   using namespace std;   void ex() {     cout <<  NO n ;     exit(0);   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int n;     cin >> n;     vector<pair<bool, int> > q(2 * n);     for (int i = 0; i < 2 * n; ++i) {       char t;       cin >> t;       if (t ==  + ) {         q[i] = {true, -1};       } else {         int x;         cin >> x;         q[i] = {false, x};       }     }     reverse(q.begin(), q.end());     vector<int> w, e;     for (int i = 0; i < 2 * n; ++i) {       if (q[i].first) {         if (!e.empty()) {           w.push_back(e.back());           e.pop_back();         } else {           ex();         }       } else {         if (!e.empty() and e.back() < q[i].second) {           ex();         }         e.push_back(q[i].second);       }     }     if (!e.empty()) {       ex();     }     cout <<  YES n ;     for (int i = n - 1; i > -1; --i) {       cout << w[i] <<    ;     }     cout <<   n ;   }   