#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <climits>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <type_traits>
#include <utility>
#include <vector>

using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;
using intl32 = std::int_least32_t;
using intl64 = std::int_least64_t;
using uintl32 = std::uint_least32_t;
using uintl64 = std::uint_least64_t;

template<std::uint_fast32_t MOD>
class modint {
public:
	std::uint_fast32_t a;
	modint() :a(0) {}
	modint(int64 x) :a(norms(x%MOD + MOD)) {}
	static std::uint_fast32_t norms(const std::uint_fast32_t &x) { return(x<MOD) ? x : x - MOD; }
	static modint make(const std::uint_fast32_t &x) { modint ret;ret.a = x;return ret; }
	const modint operator+(const modint &o)const { return make(norms(a + o.a)); }
	const modint operator-(const modint &o)const { return make(norms(a + MOD - o.a)); }
	const modint operator*(const modint &o)const { return make((std::uint_fast64_t)a*o.a%MOD); }
	const modint operator/(const modint &o)const { return make((std::uint_fast64_t)a*~o%MOD); }
	modint &operator+=(const modint &o) { return *this = *this + o; }
	modint &operator-=(const modint &o) { return *this = *this - o; }
	modint &operator*=(const modint &o) { return *this = *this * o; }
	modint &operator/=(const modint &o) { return *this = *this / o; }
	modint &operator^=(const std::uint_fast32_t &o) { return *this = *this^o; }
	const modint operator~ ()const { return *this ^ (MOD - 2); }
	const modint operator- ()const { return make(norms(MOD - a)); }
	const modint operator++() { return *this = make(norms(a + 1)); }
	const modint operator--() { return *this = make(norms(a + MOD - 1)); }
	const bool operator! ()const { return !a; }
	const bool operator==(const modint &o)const { return a == o.a; }
	const bool operator!=(const modint &o)const { return a != o.a; }
	const bool operator< (const modint &o)const { return a < o.a; }
	const bool operator<=(const modint &o)const { return a <= o.a; }
	const bool operator> (const modint &o)const { return a > o.a; }
	const bool operator>=(const modint &o)const { return a >= o.a; }
	const modint operator^(std::uint_fast32_t x)const {
		std::uint_fast64_t t = (std::uint_fast64_t)a;std::uint_fast64_t u = 1;
		while (x) { if (x & 1) u = u*t%MOD;t = (t*t) % MOD;x >>= 1; }
		return make((std::uint_fast32_t)u);
	}
	friend std::istream &operator>>(std::istream &is, modint<MOD> &o) {
		std::int_fast64_t x;is >> x;o = modint<MOD>(x);return(is);
	}
	friend std::ostream &operator<<(std::ostream &os, const modint<MOD> &o) { return os << o.a; }
};

using mint = modint<1000000007>;
int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	uint32 n;
	std::string s;
	std::cin >> n >> s;
	mint dp[5003][5003] = {};
	dp[0][0] = 1;
	for (uint32 i = 1;i <= n;++i) {
		dp[i][0] = dp[i - 1][1] + dp[i - 1][1] + dp[i - 1][0];
		for (uint32 j = 1;j <= i;++j) {
			dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j + 1] + dp[i - 1][j + 1];
		}
	}
	std::cout << dp[n][s.length()] << "\n";
	return 0;
}

Measured memory_bytes: 195840