//const int N = 5005;
//Factorial f(N);
//ll brackets[N][N];
//ll oeis(ll n, ll m){
//    if(n == 0 && m == 0) return 1;
//    if(n == 0 && m == 1) return 0;
//    if((n-1)/2-m/2 < (m+1)/2-1) return 0;
//    return m*f.comb(2*((n-1)/2)-2*(m/2)+1-m%2,(n-1)/2-m/2-(m+1)/2+1)%MOD*f.ifact[(n-1)/2+1]%MOD*f.fact[(n-1)/2]%MOD;
//}
//void __(){
//    _(int,n);
//    _(string,s);
//    vvl dp(N,vl(N));
//    dp[1][1] = 1;
//    ll ans = 0;
//    rep(wasted,0,n-sz(s)){
//        int extra_room = n-wasted-sz(s);
//        if(extra_room%2) continue;
//        rep(parts,0,extra_room/2){
//            ll ways = oeis(extra_room,parts);
//            ways = ways*ipow(2,extra_room/2)%MOD;
//            ways = ways*f.comb(sz(s)+wasted+parts,parts)%MOD;
//            ans += ways;
//        }
//    }
//    ans %= MOD;
//    print ans;
//}
//
#include <iomanip>
#include <cassert>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define REP_INT(i,l,r) for(int i = l; i <= r; ++i)
#define GET_REP_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define rep(...) GET_REP_MACRO(__VA_ARGS__,REP_ANY,REP_INT,REP_ZERO_INT)(__VA_ARGS__)
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
const ll MOD = 1e9 + 7;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
T1 T ext_euclid(T a, T b, T c, T d){
    if(c == T(0))
        return b;
    return ext_euclid(c, d, a % c, b - a / c * d);
}
T1 T mod_inverse(T x, T mod = T(MOD)){
    return (ext_euclid(mod, T(0), x, T(1)) + mod) % mod;
}
ll mod_inverse(int x, ll mod = MOD){
    return mod_inverse<ll>(x,mod);
}
ll ipow(ll x, ll p, ll mod = MOD){
    if(abs(x) >= mod)
        x %= mod;
    if(x < 0)
        x += mod;
    if(p == 0)
        return 1;
    if(p == 1)
        return x;
    return ipow(x * x % mod, p / 2, mod) * ipow(x, p % 2, mod) % mod;
}
struct Factorial{
    vl fact,ifact;
    ll comb(ll n, ll m){
        assert(n >= m);
        assert(n < sz(fact));
        return fact[n]*ifact[m]%MOD*ifact[n-m]%MOD;
    }
    Factorial(int n){
        fact.resize(n+1);
        ifact.resize(n+1);
        fact[0] = 1;
        for(int i = 1; i <= n; ++i)
            fact[i] = fact[i-1]*i%MOD;
        ifact[n] = mod_inverse(fact[n]);
        for(int i = n-1; i >= 0; --i)
            ifact[i] = (i+1)*ifact[i+1]%MOD;
    }
};
struct _print {
    string sep,end;
    bool space;
    ostream &stream;
    _print(string _sep=" ",string _end="\n",
            ostream &_stream = cout)
        : sep(_sep),end(_end),space(false),
            stream(_stream) {}
    ~_print() { stream << end; }
    template <typename T>
        _print &operator , (const T &t) {
            if (space) stream << sep;
            space = true;
            stream << t;
            return *this;
        }
};
#define print _print(),
#define INPUT_WITHOUT_INIT(type,name) type name; cin >> name
#define GET_INPUT_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define _(...) GET_INPUT_MACRO(__VA_ARGS__,_IWI,_IWI,_IWI,_IWI,_IWI,_IWI,INPUT_WITHOUT_INIT)(__VA_ARGS__)
const int N = 5005;
Factorial f(N);
ll brackets[N][N];
ll oeis(ll n, ll m){
    if(n == 0 && m == 0) return 1;
    if(n == 0 && m == 1) return 0;
    if((n-1)/2-m/2 < (m+1)/2-1) return 0;
    return m*f.comb(2*((n-1)/2)-2*(m/2)+1-m%2,(n-1)/2-m/2-(m+1)/2+1)%MOD*f.ifact[(n-1)/2+1]%MOD*f.fact[(n-1)/2]%MOD;
}
void __(){
    _(int,n);
    _(string,s);
    vvl dp(N,vl(N));
    dp[1][1] = 1;
    ll ans = 0;
    rep(wasted,0,n-sz(s)){
        int extra_room = n-wasted-sz(s);
        if(extra_room%2) continue;
        rep(parts,0,extra_room/2){
            ll ways = oeis(extra_room,parts);
            ways = ways*ipow(2,extra_room/2)%MOD;
            ways = ways*f.comb(sz(s)+wasted+parts,parts)%MOD;
            ans += ways;
        }
    }
    ans %= MOD;
    print ans;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        __();
}


Measured memory_bytes: 196224