#include <bits/stdc++.h>   using namespace std;   const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1};   const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1};   const int ms[] = {+31, +29, +31, 30, +31, +30, +31, +31, +30, +31, +30, +31};   const int N = 200 + 5;   const int MOD = 1e9 + 7;   void add(int &a, int b) {     a += b;     while (a >= MOD) a -= MOD;   }   int dp[N][N][N];   int n, first[N];   string w;   int failure(char letra, int idx) {     if (idx >= (int)w.size()) return (int)w.size();     while (idx > 0 && letra != w[idx]) {       idx = first[idx - 1];     }     return idx + (w[idx] == letra);   }   void KMP() {     first[0] = 0;     for (int i = 1; i < (int)(int)w.size(); i++) {       first[i] = failure(w[i], first[i - 1]);     }   }   int solve(int p = 0, int streak = 0, int score = 0) {     if (score < 0) return 0;     if (p >= 2 * n) return (streak == (int)w.size() && score == 0);     int &rec = dp[p][streak][score];     if (~rec) return rec;     rec = 0;     add(rec, solve(p + 1, failure( ( , streak), score + 1));     add(rec, solve(p + 1, failure( ) , streak), score - 1));     return rec;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n >> w;     KMP();     memset(dp, -1, sizeof(dp));     cout << solve() <<   n ;     return 0;   }   