#include <cstdio>
#include <cstring>
#include <vector>

using namespace std;

constexpr int mod = 1000000007;

int main()
{
    int N;
    scanf("%d\n", &N);
    int S;
    {
        char temp[5001];
        scanf("%[^\n]\n", temp);
        S = strlen(temp);
    }

    vector<int> row(N + 1);
    vector<int> row_old(N + 1); // table[0]
    row_old[0] = 1;
    for (int n = 1; n < N; ++n){
        for (int s = 0; s <= n; ++s){
            row[s] = row_old[max(0, s - 1)];
            row[s] += (row_old[s + 1] * 2) % mod;
            row[s] %= mod;
        }
        row_old.swap(row);
    }
    printf("%d\n", (row_old[S - 1] + (row_old[S + 1] * 2) % mod) % mod);
}
