#include <bits/stdc++.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 1 << 30
#define LLINF 1LL << 60
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef long long ll;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
typedef complex<double> dcomplex;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
ll gcd(ll a,ll b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll fact(ll a){ll b=1;FOR(i,1,a)b*=i;return b;}
ll power(ll x,ll n){ll a=1;REP(i,n)a*=x;return a;}

template <long long modulo>
class Modulo
{
private:
  long long pow(long long q)
  {
    long long a=1;
    long long y=x;
    for(;q!=0;q>>=1)
    {
      if(q&1LL)a=(a*y)%mod;
      y=(y*y)%mod;
    }
    return a;
  }
  long long inv(){return pow(mod-2);}

public:
  long long mod = modulo;
  unsigned long long x;
  Modulo() : x(0) {}
  Modulo(signed s) {while(s<0)s+=mod;x=s%mod;}
  Modulo(signed long long s) {while(s<0)s+=mod;x=s%mod;}
  operator int(){return (int) x;}
  operator long long(){return (long long) x;}
  void operator++(){(*this)+=1;}
  void operator--(){(*this)-=1;}
  Modulo &operator+=(Modulo q){if((x+=q.x)>=mod)x-=mod; return *this;}
  Modulo &operator-=(Modulo q){if((x+=mod-q.x)>=mod)x-=mod; return *this;}
  Modulo &operator*=(Modulo q){x=(unsigned long long)x*q.x%mod; return *this;}
  Modulo &operator/=(Modulo q){x=(unsigned long long)x*q.inv()%mod; return *this;}
  Modulo operator+(Modulo q){return Modulo(*this)+=q;}
  Modulo operator-(Modulo q){return Modulo(*this)-=q;}
  Modulo operator*(Modulo q){return Modulo(*this)*=q;}
  Modulo operator/(Modulo q){return Modulo(*this)/=q;}
  template<typename T> Modulo &operator+=(const T q){if((x+=q)>=mod)x-=mod; return *this;}
  template<typename T> Modulo &operator-=(const T q){if((x+=mod-q)>=mod)x-=mod; return *this;}
  template<typename T> Modulo &operator*=(const T q){x=(unsigned long long)x*q%mod; return *this;}
  template<typename T> Modulo &operator/=(const T q){x=(unsigned long long)x*(Modulo(q)).inv()%mod; return *this;}
  template<typename T> Modulo operator+(const T q){return Modulo(*this)+=q;}
  template<typename T> Modulo operator-(const T q){return Modulo(*this)-=q;}
  template<typename T> Modulo operator*(const T q){return Modulo(*this)*=q;}
  template<typename T> Modulo operator/(const T q){return Modulo(*this)/=q;}
  template<typename T> Modulo power(const T q){return Modulo(pow((long long)q));}
};

const int N=5010;
ll dp[N][N];

int main()
{
  int n,k;cin>>n;
  string s;cin>>s;
  k=s.size();
  dp[0][0]=1;
  FOR(i,1,N-1)
  {
    dp[i][0]=(dp[i-1][0]+dp[i-1][1]*2)%MOD;
    FOR(j,1,N-2)
    {
      dp[i][j]=(dp[i-1][j-1]+dp[i-1][j+1]*2)%MOD;
    }
    dp[i][N-1]=dp[i-1][N-2];
  }
  cout << (ll)(dp[n][k]) << endl;
  return 0;
}


Measured memory_bytes: 196352