func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 12 + 1, M = 1 << N | 5;   bool dp1[M][N + N], dp2[M][N + N];   int n, k, mx[M], c[N + N];   int main() {     cin >> n;     dp1[0][1] = true;     for (int i = 0; i < n; i++) {       cin >> c[i];       if (c[i] < 2) n--, k++, i--;     }     if (n > k) return cout <<  NO , 0;     for (int i = 1; i <= k; i++) {       dp1[0][i] = true;       dp2[0][i] = (i > 1);     }     for (int i = 0; i < n; i++) dp1[1 << i][c[i] - 1] = (c[i] > 2);     for (int i = 1; i < 1 << n; i++) {       int &u = mx[i] = __builtin_ctz(i);       if (i ^ i & -i && c[u] < c[mx[i ^ i & -i]]) u = mx[i ^ i & -i];       for (int j = 1; j <= k; j++)         for (int x = i; x; --x &= i)           for (int y = 0; y <= j; y++) {             if (~x >> u & 1 && c[u] == __builtin_popcount(i) + j)               dp1[i][j] |= dp1[x][y] && (dp1[i ^ x ^ 1 << u][j - y] ||                                          dp2[i ^ x ^ 1 << u][j - y]);             dp2[i][j] |= dp1[x][y] && (dp1[i ^ x][j - y] || dp2[i ^ x][j - y]);           }     }     cout << (dp1[(1 << n) - 1][k] ?  YES  :  NO );   }   