func_code_string: #include <bits/stdc++.h>   using namespace std;   struct kmp {     vector<int> lps;     string pattern;     void compute_lps() {       int lptr = 0, rptr = 1;       lps[0] = 0;       while (rptr < lps.size()) {         while (lptr != 0 && pattern[lptr] != pattern[rptr]) lptr = lps[lptr - 1];         if (pattern[lptr] == pattern[rptr]) lptr++;         lps[rptr] = lptr;         rptr++;       }     }     kmp(string& s) {       pattern = s;       lps.resize(s.size());       compute_lps();     }     void search(string& s) {       vector<int> hits;       int lptr = 0, rptr = 0;       while (rptr < s.size()) {         while (lptr != 0 && pattern[lptr] != s[rptr]) lptr = lps[lptr - 1];         if (pattern[lptr] == s[rptr]) lptr++;         rptr++;         if (lptr == pattern.size()) {           hits.push_back(rptr - pattern.size());           lptr = lps[lptr - 1];         }       }     }   };   long long mod = 1e9 + 7;   long long add(long long a, long long b) { return (a + b) % mod; }   long long sub(long long a, long long b) { return ((a - b) % mod + mod) % mod; }   long long mul(long long a, long long b) { return (a * b) % mod; }   const int maxn = 205;   long long dp[maxn][maxn][maxn][2], ans;   int n;   string s;   int getmaxlen(kmp& KMP, char t, int mptr) {     if (mptr == s.size()) mptr = KMP.lps[mptr - 1];     while (s[mptr] != t && mptr != 0) mptr = KMP.lps[mptr - 1];     if (s[mptr] == t) mptr++;     return mptr;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     cin >> n >> s;     dp[0][0][0][0] = 1;     kmp KMP(s);     for (int i = 0; i < (2 * n); i++) {       for (int j = 0; j <= n; j++) {         for (int k = 0; k < (2 * n) && k <= s.size(); k++) {           for (int l = 0; l < 2; l++) {             if (dp[i][j][k][l] == 0) continue;             int mptr = getmaxlen(KMP,  ( , k);             int matched = l;             if (mptr == s.size()) matched = 1;             dp[i + 1][j + 1][mptr][matched] =                 add(dp[i + 1][j + 1][mptr][matched], dp[i][j][k][l]);             if (j != 0) {               mptr = getmaxlen(KMP,  ) , k);               matched = l;               if (mptr == s.size()) matched = 1;               dp[i + 1][j - 1][mptr][matched] =                   add(dp[i + 1][j - 1][mptr][matched], dp[i][j][k][l]);             }           }         }       }     }     for (int i = 0; i <= s.size(); i++) ans = add(ans, dp[2 * n][0][i][1]);     cout << ans;     return 0;   }   