#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
using namespace std;

template <int64_t M>
class mint {
public:
        mint() :v(-1) {}
        mint(int n) : v(n % M) {}

        int64_t get() const { return v; }

        mint &operator+=(const mint &r) {
                v = (v + r.v) % M;
                return *this;
        }
        mint &operator-=(const mint &r) {
                v = (v - r.v + M) % M;
                return *this;
        }
        mint &operator*=(const mint &r) {
                v = (v * r.v) % M;
                return *this;
        }
        mint &operator/=(const mint &r) {
                return (*this) *= r.inv();
        }

        mint pow(int r) const {
                mint k = *this, ret = 1;
                while (r > 0) {
                        if (r % 2 != 0) ret *= k;
                        r /= 2;
                        k *= k;
                }
                return ret;
        }

        mint inv() const {
                return pow(M - 2);
        }

private:
        int64_t v;
};

template <int64_t M>
inline mint<M> operator+(mint<M> l, const mint<M> &r) {
        return l += r;
}

template <int64_t M>
inline mint<M> operator-(mint<M> l, const mint<M> &r) {
        return l -= r;
}

template <int64_t M>
inline mint<M> operator*(mint<M> l, const mint<M> &r) {
        return l *= r;
}

template <int64_t M>
inline mint<M> operator/(mint<M> l, const mint<M> &r) {
        return l /= r;
}

template <int64_t M>
inline ostream &operator<<(ostream &os, const mint<M> &r) {
        return os << r.get();
}

typedef mint<1000000007> MINT;

/*
MINT tbl[301][301][301];
bool flg[301][301][301];

int n;
string s;

MINT solve(int pref, int suf, int rest)
{
    if (rest == 0) {
        if (pref == 0 && suf == 0) return 1;
        return 0;
    }

    MINT &ret = tbl[pref][suf][rest];
    if (flg[pref][suf][rest]) return ret;

    flg[pref][suf][rest] = true;
    ret = 0;

    if (suf > 0) {
        ret += solve(pref, suf - 1, rest - 1);
    } else if (pref > 0) {
        ret += solve(pref - 1, suf, rest - 1);
    }

    if (pref == 0 && suf == 0) {
        ret += solve(0, 0, rest - 1) + solve(0, 1, rest - 1)* MINT(2);
    } else {
        ret += solve(pref, suf + 1, rest - 1)* MINT(2);
    }

    return ret;
}

int main()
{
    cin >> n;
    cin >> s;

    memset(&flg, 0, sizeof(flg));
    cout << solve(s.size(), 0, n) << endl;

    return 0;
}
*/


MINT tbl[5001][5001];
bool flg[5001][5001];

int n;
string s;

MINT solve(int pref, int rest)
{
    if (pref > rest) return 0;

    if (rest == 0) {
        if (pref == 0) return 1;
        return 0;
    }

    MINT &ret = tbl[pref][rest];
    if (flg[pref][rest]) return ret;

    flg[pref][rest] = true;
    ret = 0;

    if (pref > 0) {
        ret += solve(pref - 1, rest - 1);
    }

    if (pref == 0) {
        ret += solve(0, rest - 1) + solve(1, rest - 1)* MINT(2);
    } else {
        ret += solve(pref + 1, rest - 1)* MINT(2);
    }

    return ret;
}

int main()
{
    cin >> n;
    cin >> s;

    memset(&flg, 0, sizeof(flg));
    cout << solve(s.size(), n) << endl;

    return 0;
}

Measured memory_bytes: 220288