#include<bits/stdc++.h>

using namespace std;

#define ll long long
const ll mod =  1e9+7;

int n, m;
ll f[2005][2005], ans;
string s;
int main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> s;
    s = ' ' + s;
    f[0][0] = f[1][1] = 1;

    int lim;
    for(int i = 2;i <= 2000;i++) {
        lim = min(i, 2000-i);
       // lim = i;
        for(int j = 0;j <= lim;j++)
            if(j) f[i][j] = (f[i-1][j-1] + f[i-1][j+1])%mod;
            else f[i][j] = f[i-1][j+1];
    }

    int op_id = 0, cl_id = 0, len = n - m;
    stack<int> st;
    for(int i = 1;i <= m;i++)
        if(s[i] == ')')
            if(!st.empty()) st.pop();
            else op_id++;
        else st.push(1);
    cl_id = st.size();
   // cout << op_id << ' ' << cl_id << endl;
    for(int i = 0;i <= len;i++)
        for(int j = op_id;j <= i;j++)
        if(len-i >= cl_id + j - op_id)
            ans = (ans + f[i][j]*f[len-i][cl_id + j - op_id] + 1LL*mod*mod)%mod;

    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define M 1000000007
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define mod 998244353
#define sz(v) (int)(v).size()

#define pii pair<int, int>
#define vi vector<int>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)

ll add(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a+b)%M;
	return (p+M)%M;
}

ll mul(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a*b)%M;
	return (p+M)%M;
}

ll dp[2010][2010];

int main()
{
	fastio;
	ll i,j,k,n,m;
	cin>>n>>m;
	string str;
	cin>>str;
	ll mi=0,cnt=0;
	for(i=0;i<m;i++)
	{
		if(str[i]=='(')
			cnt++;
		else
			cnt--;
		mi=min(mi,cnt);
	}
	ll len = n-m;
	dp[0][0]=1;
	for(i=1;i<=len;i++)
	{
		dp[i][0] = dp[i-1][1];
		// cout<<dp[i][0]<<" ";
		for(j=1;j<=len;j++)
		{
			dp[i][j]=add(dp[i-1][j-1],dp[i-1][j+1]);
			// cout<<dp[i][j]<<" ";
		}
		// cout<<endl;
	}
	ll ans=0;
	mi=-mi;
	for(i=0;i<=len;i++)
	{
		for(j=mi;j<=i;j++)
		{
			if((j+cnt>len))
				continue;
			ans=add(ans,mul(dp[i][j],dp[len-i][j+cnt]));
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define M 1000000007
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define mod 998244353
#define sz(v) (int)(v).size()

#define pii pair<int, int>
#define vi vector<int>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)

ll add(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a+b)%M;
	return (p+M)%M;
}

ll mul(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a*b)%M;
	return (p+M)%M;
}

ll dp[2010][2010];

int main()
{
	fastio;
	ll i,j,k,n,m;
	cin>>n>>m;
	string str;
	cin>>str;
	ll mi=0,cnt=0;
	for(i=0;i<m;i++)
	{
		if(str[i]=='(')
			cnt++;
		else
			cnt--;
		mi=min(mi,cnt);
	}
	ll len = n-m;
	dp[0][0]=1;
	for(i=1;i<=len;i++)
	{
		dp[i][0] = dp[i-1][1];
		// cout<<dp[i][0]<<" ";
		for(j=1;j<=len;j++)
		{
			dp[i][j]=add(dp[i-1][j-1],dp[i-1][j+1]);
			// cout<<dp[i][j]<<" ";
		}
		// cout<<endl;
	}
	ll ans=0;
	for(i=0;i<=len;i++)
	{
		for(j=0;j<=i;j++)
		{
			if(j+cnt+mi<0)
				continue;
			ans=add(ans,mul(dp[i][j],dp[len-i][j+cnt+mi]));
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define M 1000000007
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define mod 998244353
#define sz(v) (int)(v).size()

#define pii pair<int, int>
#define vi vector<int>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)

ll add(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a+b)%M;
	return (p+M)%M;
}

ll mul(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a*b)%M;
	return (p+M)%M;
}

ll dp[2010][2010];

int main()
{
	fastio;
	ll i,j,k,n,m;
	cin>>n>>m;
	string str;
	cin>>str;
	ll mi=0,cnt=0;
	for(i=0;i<m;i++)
	{
		if(str[i]=='(')
			cnt++;
		else
			cnt--;
		mi=min(mi,cnt);
	}
	ll len = n-m;
	dp[0][0]=1;
	for(i=1;i<=len;i++)
	{
		dp[i][0] = dp[i-1][1];
		// cout<<dp[i][0]<<" ";
		for(j=1;j<=len;j++)
		{
			dp[i][j]=add(dp[i-1][j-1],dp[i-1][j+1]);
			// cout<<dp[i][j]<<" ";
		}
		// cout<<endl;
	}
	ll ans=0;
	mi=-mi;
	for(i=0;i<=len;i++)
	{
		for(j=mi;j<=i;j++)
		{
			if((j+cnt<0)||(j+cnt>len))
				continue;
			ans=add(ans,mul(dp[i][j],dp[len-i][j+cnt]));
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define M 1000000007
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define mod 998244353
#define sz(v) (int)(v).size()

#define pii pair<int, int>
#define vi vector<int>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)

ll add(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a+b)%M;
	return (p+M)%M;
}

ll mul(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a*b)%M;
	return (p+M)%M;
}

ll dp[2010][2010];

int main()
{
	fastio;
	ll i,j,k,n,m;
	cin>>n>>m;
	string str;
	cin>>str;
	ll mi=0,cnt=0;
	for(i=0;i<m;i++)
	{
		if(str[i]=='(')
			cnt++;
		else
			cnt--;
		mi=min(mi,cnt);
	}
	ll len = n-m;
	dp[0][0]=1;
	for(i=1;i<=len;i++)
	{
		dp[i][0] = dp[i-1][1];
		// cout<<dp[i][0]<<" ";
		for(j=1;j<=len;j++)
		{
			dp[i][j]=add(dp[i-1][j-1],dp[i-1][j+1]);
			// cout<<dp[i][j]<<" ";
		}
		// cout<<endl;
	}
	cnt=max(cnt,0LL);
	ll ans=0;
	for(i=0;i<=len;i++)
	{
		for(j=0;j<=i;j++)
		{
			if(j+cnt+mi<0)
				continue;
			ans=add(ans,mul(dp[i][j],dp[len-i][j+cnt+mi]));
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define M 1000000007
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define mod 998244353
#define sz(v) (int)(v).size()

#define pii pair<int, int>
#define vi vector<int>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)

ll add(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a+b)%M;
	return (p+M)%M;
}

ll mul(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a*b)%M;
	return (p+M)%M;
}

ll dp[2010][2010];

int main()
{
	fastio;
	ll i,j,k,n,m;
	cin>>n>>m;
	string str;
	cin>>str;
	ll mi=0,cnt=0;
	for(i=0;i<m;i++)
	{
		if(str[i]=='(')
			cnt++;
		else
			cnt--;
		mi=min(mi,cnt);
	}
	ll len = n-m;
	dp[0][0]=1;
	for(i=1;i<=len;i++)
	{
		dp[i][0] = dp[i-1][1];
		// cout<<dp[i][0]<<" ";
		for(j=1;j<=len;j++)
		{
			dp[i][j]=add(dp[i-1][j-1],dp[i-1][j+1]);
			// cout<<dp[i][j]<<" ";
		}
		// cout<<endl;
	}
	ll ans=0;
	mi=-mi;
	for(i=0;i<=len;i++)
	{
		for(j=mi;j<=i;j++)
		{
			if(j+cnt<0)
				continue;
			ans=add(ans,mul(dp[i][j],dp[len-i][j+cnt]));
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 1; i <= n; i++)
#define pb push_back
const ll M = 1e5;
const ll inf=2e9+5;
const ll MOD = 1e9+7;
const double PI= 3.14159265358979323846;
#define mp make_pair
typedef pair<ll, ll> pi;
typedef pair<ll, pi> pii;
typedef pair<pi,pi> piii;
typedef vector<ll> vi;
typedef vector<pi> vii;
typedef vector< vi > matrix;
ll open,pre,bef;
ll dp[M+3][2],dp1[M +3][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);

  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;

  rep(i,m)
  {
    if(s[i-1]=='(') open++;
    else open--;
    if(open<0) pre++,open++;
  }
  bef=open;

  dp[0][0]=1;
  rep(i,n-m+1)
  {
    for(ll j=0;j<=n/2;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        if(j>0)
          dp1[j][k]=(dp1[j][k]+(dp[j-1][k]%MOD))%MOD;
       dp1[j][k]=(dp1[j][k]+(dp[j+1][k]%MOD))%MOD;
       if((k==1) && (j + pre - bef>=pre))
         dp1[j][k] = (dp1[j][k] + (dp[j + pre - bef ][0] % MOD)) % MOD;
      }
    }

    for(ll j=0;j<=n/2;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        dp[j][k]=dp1[j][k];
        dp1[j][k]=0;
      }
    }
  }
  cout << dp[0][1] << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 1; i <= n; i++)
#define pb push_back
const ll M = 6000;
const ll inf=2e9+5;
const ll MOD = 1e9+7;
const double PI= 3.14159265358979323846;
#define mp make_pair
typedef pair<ll, ll> pi;
typedef pair<ll, pi> pii;
typedef pair<pi,pi> piii;
typedef vector<ll> vi;
typedef vector<pi> vii;
typedef vector< vi > matrix;
ll open,pre,bef;
ll dp[M+3][2],dp1[M +3][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;

  rep(i,m)
  {
    if(s[i-1]=='(') open++;
    else open--;
    if(open<0) pre++,open++;
  }
  bef=open;

  dp[0][0]=1;
  rep(i,n-m+1)
  {
    for(ll j=0;j<=3000;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        if(j>0)
          dp1[j][k]=(dp1[j][k]+dp[j-1][k])%MOD;
       dp1[j][k]=(dp1[j][k]+dp[j+1][k])%MOD;
       if((k==1) && (j + pre - bef>=pre) && (j + pre - bef<=5000))
         dp1[j][k] = (dp1[j][k] + dp[j + pre - bef ][0] ) % MOD;
      }
    }

    for(ll j=0;j<=3000;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        dp[j][k]=dp1[j][k];
        dp1[j][k]=0;
      }
    }
  }
  cout << dp[0][1] << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 1; i <= n; i++)
#define pb push_back
const ll M = 1e5;
const ll inf=2e9+5;
const ll MOD = 1e9+7;
const double PI= 3.14159265358979323846;
#define mp make_pair
typedef pair<ll, ll> pi;
typedef pair<ll, pi> pii;
typedef pair<pi,pi> piii;
typedef vector<ll> vi;
typedef vector<pi> vii;
typedef vector< vi > matrix;
ll open,pre,bef;
ll dp[M+3][2],dp1[M +3][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);

  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;

  rep(i,m)
  {
    if(s[i-1]=='(') open++;
    else open--;
    if(open<0) pre++,open++;
  }
  bef=open;

  dp[0][0]=1;
  rep(i,n-m+1)
  {
    for(ll j=0;j<=n/2;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        if(j>0)
          dp1[j][k]=(dp1[j][k]+dp[j-1][k])%MOD;
       dp1[j][k]=(dp1[j][k]+dp[j+1][k])%MOD;
       if((k==1) && (j + pre - bef>=pre))
         dp1[j][k] = (dp1[j][k] + dp[j + pre - bef ][0] ) % MOD;
      }
    }

    for(ll j=0;j<=n/2;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        dp[j][k]=dp1[j][k];
        dp1[j][k]=0;
      }
    }
  }
  cout << dp[0][1] << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 1; i <= n; i++)
#define pb push_back
const ll M = 3000;
const ll inf=2e9+5;
const ll MOD = 1e9+7;
const double PI= 3.14159265358979323846;
#define mp make_pair
typedef pair<ll, ll> pi;
typedef pair<ll, pi> pii;
typedef pair<pi,pi> piii;
typedef vector<ll> vi;
typedef vector<pi> vii;
typedef vector< vi > matrix;
ll open,pre,bef;
ll dp[M+3][2],dp1[M +3][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;

  rep(i,m)
  {
    if(s[i-1]=='(') open++;
    else open--;
    if(open<0) pre++,open++;
  }
  bef=open;

  dp[0][0]=1;
  rep(i,n-m+1)
  {
    for(ll j=0;j<=3000;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        if(j>0)
          dp1[j][k]=(dp1[j][k]+dp[j-1][k])%MOD;
       dp1[j][k]=(dp1[j][k]+dp[j+1][k])%MOD;
       if((k==1) && (j + pre - bef>=pre))
         dp1[j][k] = (dp1[j][k] + dp[j + pre - bef ][0] ) % MOD;
      }
    }

    for(ll j=0;j<=3000;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        dp[j][k]=dp1[j][k];
        dp1[j][k]=0;
      }
    }
  }
  cout << dp[0][1] << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 1; i <= n; i++)
#define pb push_back
const ll M = 1e5;
const ll inf=2e9+5;
const ll MOD = 1e9+7;
const double PI= 3.14159265358979323846;
#define mp make_pair
typedef pair<ll, ll> pi;
typedef pair<ll, pi> pii;
typedef pair<pi,pi> piii;
typedef vector<ll> vi;
typedef vector<pi> vii;
typedef vector< vi > matrix;
ll open,pre,bef;
ll dp[M+3][2],dp1[M +3][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);

  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;

  rep(i,m)
  {
    if(s[i-1]=='(') open++;
    else open--;
    if(open<0) pre++,open++;
  }
  bef=open;

  dp[0][0]=1;
  rep(i,n-m+1)
  {
    for(ll j=0;j<=n;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        if(j>0)
          dp1[j][k]=(dp1[j][k]+((dp[j-1][k])%MOD))%MOD;
       dp1[j][k]=(dp1[j][k]+((dp[j+1][k])%MOD))%MOD;
       if((k==1) && (j+pre>=bef) && (j + pre - bef>=pre))
         dp1[j][k] = (dp1[j][k] + ((dp[j + pre - bef ][0] ) % MOD)) % MOD;
      }
    }

    for(ll j=0;j<=n;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        dp[j][k]=dp1[j][k];
        dp1[j][k]=0;
      }
    }
  }
  cout << dp[0][1] << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 1; i <= n; i++)
#define pb push_back
const ll M = 6000;
const ll inf=2e9+5;
const ll MOD = 1e9+7;
const double PI= 3.14159265358979323846;
#define mp make_pair
typedef pair<ll, ll> pi;
typedef pair<ll, pi> pii;
typedef pair<pi,pi> piii;
typedef vector<ll> vi;
typedef vector<pi> vii;
typedef vector< vi > matrix;
ll open,pre,bef;
ll dp[M+3][2],dp1[M +3][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;

  rep(i,m)
  {
    if(s[i-1]=='(') open++;
    else open--;
    if(open<0) pre++,open++;
  }
  bef=open;

  dp[0][0]=1;
  rep(i,n-m+1)
  {
    for(ll j=0;j<=3000;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        if(j>0)
          dp1[j][k]=(dp1[j][k]+dp[j-1][k])%MOD;
       dp1[j][k]=(dp1[j][k]+dp[j+1][k])%MOD;
       if((k==1) && (j + pre - bef>=pre))
         dp1[j][k] = (dp1[j][k] + dp[j + pre - bef ][0] ) % MOD;
      }
    }

    for(ll j=0;j<=3000;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        dp[j][k]=dp1[j][k];
        dp1[j][k]=0;
      }
    }
  }
  cout << dp[0][1] << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 1; i <= n; i++)
#define pb push_back
const ll M = 1e5;
const ll inf=2e9+5;
const ll MOD = 1e9+7;
const double PI= 3.14159265358979323846;
#define mp make_pair
typedef pair<ll, ll> pi;
typedef pair<ll, pi> pii;
typedef pair<pi,pi> piii;
typedef vector<ll> vi;
typedef vector<pi> vii;
typedef vector< vi > matrix;
ll open,pre,bef;
ll dp[M+3][2],dp1[M +3][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
f
  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;

  rep(i,m)
  {
    if(s[i-1]=='(') open++;
    else open--;
    if(open<0) pre++,open++;
  }
  bef=open;

  dp[0][0]=1;
  rep(i,n-m+1)
  {
    for(ll j=0;j<=2200;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        if(j>0)
          dp1[j][k]=(dp1[j][k]+dp[j-1][k])%MOD;
       dp1[j][k]=(dp1[j][k]+dp[j+1][k])%MOD;
       if((k==1) && (j + pre - bef>=pre))
         dp1[j][k] = (dp1[j][k] + dp[j + pre - bef ][0] ) % MOD;
      }
    }

    for(ll j=0;j<=2200;j++)
    {
      for(ll k=0;k<=1;k++)
      {
        dp[j][k]=dp1[j][k];
        dp1[j][k]=0;
      }
    }
  }
  cout << dp[0][1] << "\n";
}


/*input
4 1
(

*/

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;

#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int INF = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define out(container) for (auto it : container) cout << it << " "; cout << endl;

template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

// #warning size
const int N = 2005;
int n, m;
string str;
int tn;

int dp[N][N];

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> n >> m;
  cin >> str;
  dp[0][0] = 1;
  for (int i = 1; i < N - 1; i++) {
    dp[i][0] = dp[i - 1][1];
    for (int j = 1; j <= i; j++) {
      dp[i][j] = add(dp[i - 1][j - 1], dp[i - 1][j + 1]);
    }
  }
  int mn = 0, bal = 0;
  for (auto it : str) {
    bal += (it == '(');
    bal -= (it == ')');
    mn = min(mn, bal);
  }
  mn *= -1;
  int ans = 0;
  int sz = n - m;
  for (int i = 0; i <= sz; i++) {
    for (int j = mn; j <= i; j++) {
      int rem = sz - i;
      int x = j + bal;
      if (x > rem) continue;
      //trace(i, j, rem, x, dp[i][j], dp[rem][x]);
      ans = add(ans, mul(dp[i][j], dp[rem][x]));
    }
  }
  cout << ans << endl;

  return 0;
}


/*input
4 1
(

*/

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;

#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int INF = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define out(container) for (auto it : container) cout << it << " "; cout << endl;

template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

// #warning size
const int N = 2005;
int n, m;
string str;
int tn;

int dp[N][N];

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> n >> m;
  cin >> str;
  dp[0][0] = 1;
  for (int i = 1; i < N - 1; i++) {
    dp[i][0] = dp[i - 1][1];
    for (int j = 1; j <= i; j++) {
      dp[i][j] = add(dp[i - 1][j - 1], dp[i - 1][j + 1]);
    }
  }
  int mn = 0, bal = 0;
  for (auto it : str) {
    bal += (it == '(');
    bal -= (it == ')');
    mn = min(mn, bal);
  }
  mn *= -1;
  int ans = 0;
  int sz = n - m;
  for (int i = mn; i <= sz; i++) {
    for (int j = mn; j <= i; j++) {
      int rem = sz - i;
      int x = (i - j) * (j != mn) + (bal + mn);
      //trace(i, j, rem, x, dp[i][j], dp[rem][x]);
      ans = add(ans, mul(dp[i][j], dp[rem][x]));
    }
  }
  cout << ans << endl;

  return 0;
}


/*input
4 1
(

*/

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;

#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int INF = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define out(container) for (auto it : container) cout << it << " "; cout << endl;

template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

// #warning size
const int N = 2005;
int n, m;
string str;
int tn;

int dp[N][N];

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> n >> m;
  cin >> str;
  dp[0][0] = 1;
  for (int i = 1; i < N; i++) {
    if (i % 2 == 0) dp[i][0] = dp[i - 1][1];
    for (int j = 1; j <= i; j++) {
      dp[i][j] = add(dp[i - 1][j - 1], dp[i - 1][j + 1]);
    }
  }
  int mn = 0, bal = 0;
  for (auto it : str) {
    bal += (it == '(');
    bal -= (it == ')');
    mn = min(mn, bal);
  }
  mn *= -1;
  int ans = 0;
  int sz = n - m;
  for (int i = mn; i <= sz; i++) {
    for (int j = mn; j <= i; j++) {
      int rem = sz - i;
      int x = (i - j) * (j != mn) + (bal + mn);
      //trace(i, j, rem, x, dp[i][j], dp[rem][x]);
      ans = add(ans, mul(dp[i][j], dp[rem][x]));
    }
  }
  cout << ans << endl;

  return 0;
}


/*input
4 1
(

*/

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;

#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int INF = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define out(container) for (auto it : container) cout << it << " "; cout << endl;

template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

// #warning size
const int N = 2005;
int n, m;
string str;
int tn;

int dp[N][N];

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> n >> m;
  cin >> str;
  dp[0][0] = 1;
  for (int i = 1; i < N - 1; i++) {
    if (i % 2 == 0) dp[i][0] = dp[i - 1][1];
    for (int j = 1; j <= i; j++) {
      dp[i][j] = add(dp[i - 1][j - 1], dp[i - 1][j + 1]);
    }
  }
  int mn = 0, bal = 0;
  for (auto it : str) {
    bal += (it == '(');
    bal -= (it == ')');
    mn = min(mn, bal);
  }
  mn *= -1;
  int ans = 0;
  int sz = n - m;
  for (int i = mn; i <= sz; i++) {
    for (int j = mn; j <= i; j++) {
      int rem = sz - i;
      int x = (i - j) * (j != mn) + (bal + mn);
      //trace(i, j, rem, x, dp[i][j], dp[rem][x]);
      ans = add(ans, mul(dp[i][j], dp[rem][x]));
    }
  }
  cout << ans << endl;

  return 0;
}


/*input
4 1
(

*/

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;

#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int INF = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define out(container) for (auto it : container) cout << it << " "; cout << endl;

template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

// #warning size
const int N = 2001;
int n, m;
string str;
int tn;

int dp[N][N];

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> n >> m;
  cin >> str;
  dp[0][0] = 1;
  for (int i = 1; i < N; i++) {
    if (i % 2 == 0) dp[i][0] = dp[i - 1][1];
    for (int j = 1; j <= i; j++) {
      dp[i][j] = add(dp[i - 1][j - 1], dp[i - 1][j + 1]);
    }
  }
  int mn = 0, bal = 0;
  for (auto it : str) {
    bal += (it == '(');
    bal -= (it == ')');
    mn = min(mn, bal);
  }
  mn *= -1;
  int ans = 0;
  int sz = n - m;
  for (int i = mn; i <= sz; i++) {
    for (int j = mn; j <= i; j++) {
      int rem = sz - i;
      int x = (i - j) * (j != mn) + (bal + mn);
      //trace(i, j, rem, x, dp[i][j], dp[rem][x]);
      ans = add(ans, mul(dp[i][j], dp[rem][x]));
    }
  }
  cout << ans << endl;

  return 0;
}


/*
Nahid Hossain
Jahangirnagar University
Roll:54
*/
#include<bits/stdc++.h>
#define ll          long long int
#define db          double
#define pf          printf
#define sf          scanf
#define ff          first
#define ss          second
#define clr         clear()
#define sz          size()
#define pb          push_back
#define mk          make_pair
#define pi          acos(-1)
#define inf         123456789
#define mod         1000000007
#define ull         unsigned long long int
#define f(i,k,n)    for(ll i=k;i<n;i++)
#define fr(i,n,k)   for(i=n;i>=k;i--)
#define ent(a)      scanf("%lld",&a)
#define ent2(a,b)   scanf("%lld%lld",&a,&b)
#define ent3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define mem(a)      memset(a,0,sizeof(a))
#define vec(v,s)    vector<ll>v[s]
#define arr(a,s)    ll a[s];
//#define check(n,pos) (n&(1<<pos))
//#define set(n,pos)  (n|(1<<pos))
//knight and king//
int dr[]= {2,2,-2,-2,1,-1,1,-1};
int dc[]= {1,-1,1,-1,2,2,-2,-2};
int dr1[]= {0,0,1,1,1,-1,-1,-1};
int dc1[]= {1,-1,1,0,-1,0,1,-1};
int dr2[]= {0,0,1,-1};
int dc2[]= {1,-1,0,0};
////////////////////////////
using namespace std;
#define ma 2005
ll dp[ma][ma],p;
void solve()
{
 ll i,j;
  mem(dp);
  f(i,0,p+1)dp[i][i]=1;
  for(i=1;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    if(j>0)dp[i][j]=dp[i-1][j-1];
    if(i>1)
    dp[i][j]+=dp[i-1][j+1];
    dp[i][j]%=mod;
   }
  }
}
int main()
{
 ll n,m,cn,i,j;
 string t;
 while(cin>>n>>m)
 {
  cin>>t;
  cn=0;
  f(i,0,t.sz)
  {
   if(t[i]=='(')cn++;
   else cn--;
  }
  p=n-m;
  solve();
  ll ans=0;
  for(i=0;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    ll k2=j+cn;
    ll k3=n-m-i;
    if(k2<0||k3<0)continue;
    //cout<<i<<" "<<j<<" "<<k3<<" "<<k2<<endl;
    //cout<<dp[i][j]<<" "<<dp[k3][k2]<<endl;
    ans+=(dp[i][j]%mod*dp[k3][k2]%mod)%mod;
    ans%=mod;
   }
  }
  cout<<ans<<endl;
 }

 return 0;
}


/*
Nahid Hossain
Jahangirnagar University
Roll:54
*/
#include<bits/stdc++.h>
#define ll          long long int
#define db          double
#define pf          printf
#define sf          scanf
#define ff          first
#define ss          second
#define clr         clear()
#define sz          size()
#define pb          push_back
#define mk          make_pair
#define pi          acos(-1)
#define inf         123456789
#define mod         1000000007
#define ull         unsigned long long int
#define f(i,k,n)    for(ll i=k;i<n;i++)
#define fr(i,n,k)   for(i=n;i>=k;i--)
#define ent(a)      scanf("%lld",&a)
#define ent2(a,b)   scanf("%lld%lld",&a,&b)
#define ent3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define mem(a)      memset(a,0,sizeof(a))
#define vec(v,s)    vector<ll>v[s]
#define arr(a,s)    ll a[s];
//#define check(n,pos) (n&(1<<pos))
//#define set(n,pos)  (n|(1<<pos))
//knight and king//
int dr[]= {2,2,-2,-2,1,-1,1,-1};
int dc[]= {1,-1,1,-1,2,2,-2,-2};
int dr1[]= {0,0,1,1,1,-1,-1,-1};
int dc1[]= {1,-1,1,0,-1,0,1,-1};
int dr2[]= {0,0,1,-1};
int dc2[]= {1,-1,0,0};
////////////////////////////
using namespace std;
#define ma 2005
ll dp[ma][ma],p;
void solve()
{
 ll i,j;
  mem(dp);
  f(i,0,p+1)dp[i][i]=1;
  for(i=1;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    if(j>0)dp[i][j]=dp[i-1][j-1];
    if(i>1)
    dp[i][j]+=dp[i-1][j+1];
    dp[i][j]%=mod;
   }
  }
}
int main()
{
 ll n,m,cn,i,j;
 string t;
 while(cin>>n>>m)
 {
  cin>>t;
  cn=0;
  ll min1=inf;
  f(i,0,t.sz)
  {
   if(t[i]=='(')cn++;
   else cn--;
   min1=min(cn,min1);
  }
  min1*=-1;
  p=n-m;
  solve();
  ll ans=0;
  for(i=0;i<=p;i++)
  {
   for(j=min1;j<=i;j++)
   {
    ll k2=j+cn;
    ll k3=n-m-i;
    if(k2<0||k3<0)continue;
    //cout<<i<<" "<<j<<" "<<k3<<" "<<k2<<endl;
    //cout<<dp[i][j]<<" "<<dp[k3][k2]<<endl;
    ans+=(dp[i][j]%mod*dp[k3][k2]%mod)%mod;
    ans%=mod;
   }
  }
  cout<<ans<<endl;
 }

 return 0;
}


/*
Nahid Hossain
Jahangirnagar University
Roll:54
*/
#include<bits/stdc++.h>
#define ll          long long int
#define db          double
#define pf          printf
#define sf          scanf
#define ff          first
#define ss          second
#define clr         clear()
#define sz          size()
#define pb          push_back
#define mk          make_pair
#define pi          acos(-1)
#define inf         123456789
#define mod         1000000007
#define ull         unsigned long long int
#define f(i,k,n)    for(ll i=k;i<n;i++)
#define fr(i,n,k)   for(i=n;i>=k;i--)
#define ent(a)      scanf("%lld",&a)
#define ent2(a,b)   scanf("%lld%lld",&a,&b)
#define ent3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define mem(a)      memset(a,0,sizeof(a))
#define vec(v,s)    vector<ll>v[s]
#define arr(a,s)    ll a[s];
//#define check(n,pos) (n&(1<<pos))
//#define set(n,pos)  (n|(1<<pos))
//knight and king//
int dr[]= {2,2,-2,-2,1,-1,1,-1};
int dc[]= {1,-1,1,-1,2,2,-2,-2};
int dr1[]= {0,0,1,1,1,-1,-1,-1};
int dc1[]= {1,-1,1,0,-1,0,1,-1};
int dr2[]= {0,0,1,-1};
int dc2[]= {1,-1,0,0};
////////////////////////////
using namespace std;
#define ma 2005
ll dp[ma][ma],p;
void solve()
{
 ll i,j;
  mem(dp);
  f(i,0,p+1)dp[i][i]=1;
  for(i=1;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    if(j>0)dp[i][j]=dp[i-1][j-1];
    if(i>1)
    dp[i][j]+=dp[i-1][j+1];
    dp[i][j]%=mod;
   }
  }
}
int main()
{
 ll n,m,cn,i,j;
 string t;
 while(cin>>n>>m)
 {
  cin>>t;
  cn=0;
  ll min1=inf;
  f(i,0,t.sz)
  {
   if(t[i]=='(')cn++;
   else cn--;
   min1=min(cn,min1);
  }
  min1*=-1;
  p=n-m;
  solve();
  ll ans=0;
  for(i=0;i<=p;i++)
  {
   for(j=min1;j<=i;j++)
   {
    ll k2=j+cn;
    ll k3=n-m-i;
    if(k2<0||k3<0||k2>k3||k3>=ma||k2>=ma)continue;
    //cout<<i<<" "<<j<<" "<<k3<<" "<<k2<<endl;
    //cout<<dp[i][j]<<" "<<dp[k3][k2]<<endl;
    ans+=(dp[i][j]%mod*dp[k3][k2]%mod)%mod;
    ans%=mod;
   }
  }
  cout<<ans<<endl;
 }

 return 0;
}


/*
Nahid Hossain
Jahangirnagar University
Roll:54
*/
#include<bits/stdc++.h>
#define ll          long long int
#define db          double
#define pf          printf
#define sf          scanf
#define ff          first
#define ss          second
#define clr         clear()
#define sz          size()
#define pb          push_back
#define mk          make_pair
#define pi          acos(-1)
#define inf         123456789
#define mod         1000000009
#define ull         unsigned long long int
#define f(i,k,n)    for(ll i=k;i<n;i++)
#define fr(i,n,k)   for(i=n;i>=k;i--)
#define ent(a)      scanf("%lld",&a)
#define ent2(a,b)   scanf("%lld%lld",&a,&b)
#define ent3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define mem(a)      memset(a,0,sizeof(a))
#define vec(v,s)    vector<ll>v[s]
#define arr(a,s)    ll a[s];
//#define check(n,pos) (n&(1<<pos))
//#define set(n,pos)  (n|(1<<pos))
//knight and king//
int dr[]= {2,2,-2,-2,1,-1,1,-1};
int dc[]= {1,-1,1,-1,2,2,-2,-2};
int dr1[]= {0,0,1,1,1,-1,-1,-1};
int dc1[]= {1,-1,1,0,-1,0,1,-1};
int dr2[]= {0,0,1,-1};
int dc2[]= {1,-1,0,0};
////////////////////////////
using namespace std;
#define ma 2005
ll dp[ma][ma],p;
void solve()
{
 ll i,j;
  mem(dp);
  f(i,0,p+1)dp[i][i]=1;
  for(i=1;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    if(j>0)dp[i][j]=dp[i-1][j-1];
    if(i>1)
    dp[i][j]+=dp[i-1][j+1];
    dp[i][j]%=mod;
   }
  }
}
int main()
{
 ll n,m,cn,i,j;
 string t;
 while(cin>>n>>m)
 {
  cin>>t;
  cn=0;
  f(i,0,t.sz)
  {
   if(t[i]=='(')cn++;
   else cn--;
  }
  p=n-m;
  solve();
  ll ans=0;
  for(i=0;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    ll k2=j+cn;
    ll k3=n-m-i;
    if(k2<0||k3<0)continue;
    //cout<<i<<" "<<j<<" "<<k3<<" "<<k2<<endl;
    //cout<<dp[i][j]<<" "<<dp[k3][k2]<<endl;
    ans+=(dp[i][j]%mod*dp[k3][k2]%mod)%mod;
    ans%=mod;
   }
  }
  cout<<ans<<endl;
 }

 return 0;
}


/*
Nahid Hossain
Jahangirnagar University
Roll:54
*/
#include<bits/stdc++.h>
#define ll          long long int
#define db          double
#define pf          printf
#define sf          scanf
#define ff          first
#define ss          second
#define clr         clear()
#define sz          size()
#define pb          push_back
#define mk          make_pair
#define pi          acos(-1)
#define inf         123456789
#define mod         1000000009
#define ull         unsigned long long int
#define f(i,k,n)    for(ll i=k;i<n;i++)
#define fr(i,n,k)   for(i=n;i>=k;i--)
#define ent(a)      scanf("%lld",&a)
#define ent2(a,b)   scanf("%lld%lld",&a,&b)
#define ent3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define mem(a)      memset(a,0,sizeof(a))
#define vec(v,s)    vector<ll>v[s]
#define arr(a,s)    ll a[s];
//#define check(n,pos) (n&(1<<pos))
//#define set(n,pos)  (n|(1<<pos))
//knight and king//
int dr[]= {2,2,-2,-2,1,-1,1,-1};
int dc[]= {1,-1,1,-1,2,2,-2,-2};
int dr1[]= {0,0,1,1,1,-1,-1,-1};
int dc1[]= {1,-1,1,0,-1,0,1,-1};
int dr2[]= {0,0,1,-1};
int dc2[]= {1,-1,0,0};
////////////////////////////
using namespace std;
#define ma 2005
ll dp[ma][ma],p;
void solve()
{
 ll i,j;
  mem(dp);
  f(i,0,p+1)dp[i][i]=1;
  for(i=1;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    if(j>0)dp[i][j]=dp[i-1][j-1];
    if(i>1)
    dp[i][j]+=dp[i-1][j+1];
    dp[i][j]%=mod;
   }
  }
}
int main()
{
 ll n,m,cn,i,j;
 string t;
 while(cin>>n>>m)
 {
  cin>>t;
  cn=0;
  f(i,0,t.sz)
  {
   if(t[i]=='(')cn++;
   else cn--;
  }
  p=n-m;
  solve();
  ll ans=0;
  for(i=0;i<=p;i++)
  {
   for(j=0;j<=i;j++)
   {
    ll k2=j+cn;
    ll k3=n-m-i;
    if(k2<0||k3<0)continue;
    //cout<<i<<" "<<j<<" "<<k3<<" "<<k2<<endl;
    //cout<<dp[i][j]<<" "<<dp[k3][k2]<<endl;
    ans+=(dp[i][j]%mod*dp[k3][k2]%mod)%mod;
   }
  }
  cout<<ans<<endl;
 }

 return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	dp[0][0] = 1;
	for (int i = 1; i < N; i++)
	{
		for (int j = 0; j < N; j++)
		{
			add(dp[i][j], dp[i - 1][j + 1]);
			if (j)
				add(dp[i][j], dp[i - 1][j - 1]);
		}
	}
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}
	if (n == m && mi == 0 && ma == 0)
		return cout << 1 << endl, 0;
	if (n == m && (mi != 0 || ma != 0))
		return cout << 0 << endl, 0;
	int ans = 0;
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (j + mi < 0 || j + c > (n - m - i))
				continue;
			ll temp = 1;
			temp = (dp[i][j]) % mod;
			temp = (temp * 1ll * dp[n - m - i][j + c]) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N + 5];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	dp[0][0] = 1;
	for (int i = 1; i < N; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			add(dp[i][j], dp[i - 1][j + 1]);
			if (j)
				add(dp[i][j], dp[i - 1][j - 1]);
		}
	}
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}

	int ans = 0;
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (j + mi < 0 || j + c > (n - m - i))
				continue;
			ll temp = 1;
			temp = (dp[i][j]) % mod;
			temp = (temp * 1ll * dp[n - m - i][j + c]) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N][2], ncr[N][N];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
void pre()
{
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (i == j || j == 0)
				ncr[i][j] = 1;
			else
				add(ncr[i][j], ncr[i - 1][j]), add(ncr[i][j], ncr[i - 1][j - 1]);
		}
	}
}
int solve(int ind, int open, bool flag)
{
	if (ind == 0)
	{
		if (flag == 0)
			return open + mi == 0;
		return open == 0;
	}
	int &ret = dp[ind][open][flag];
	if (ret != -1)
		return ret;
	ret = 0;
	if (open > 0)
		add(ret, solve(ind - 1, open - 1, flag));
	add(ret, solve(ind - 1, min(N - 1, open + 1), flag));
	return ret;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	memset(dp, -1, sizeof dp);
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}
	for (int i = N - 1; i >= 0; i--)
		for (int j = N - 1; j >= 0; j--)
			solve(i, j, 1), solve(i, j, 0);
	if (n == m && mi == 0)
		return cout << 1 << endl, 0;
	if (n == m && mi != 0)
		return cout << 0 << endl, 0;
	int ans = 0;
	pre();
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			ll temp = ncr[i][j];
			temp = (temp * 1ll * solve(i - j, 0, 0)) % mod;
			if (!temp)
				continue;
			temp = (temp * 1ll * solve(n - m - i, min(N - 1, j + ma), 1)) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	dp[0][0] = 1;
	for (int i = 1; i < N; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			add(dp[i][j], dp[i - 1][j + 1]);
			if (j)
				add(dp[i][j], dp[i - 1][j - 1]);
		}
	}
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}
	if (n == m && mi == 0 && ma == 0)
		return cout << 1 << endl, 0;
	if (n == m && (mi != 0 || ma != 0))
		return cout << 0 << endl, 0;
	int ans = 0;
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (j + mi < 0 || j + c > (n - m - i))
				continue;
			ll temp = 1;
			temp = (dp[i][j]) % mod;
			temp = (temp * 1ll * dp[n - m - i][j + c]) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N][2], ncr[N][N];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
void pre()
{
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (i == j || j == 0)
				ncr[i][j] = 1;
			else
				add(ncr[i][j], ncr[i - 1][j]), add(ncr[i][j], ncr[i - 1][j - 1]);
		}
	}
}
int solve(int ind, int open, bool flag)
{
	if (open >= N)
		return 0;
	if (ind == 0)
	{
		if (flag == 0)
			return open + mi == 0;
		return open == 0;
	}
	int &ret = dp[ind][open][flag];
	if (ret != -1)
		return ret;
	ret = 0;
	if (open > 0)
		add(ret, solve(ind - 1, open - 1, flag));
	add(ret, solve(ind - 1, open + 1, flag));
	return ret;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	memset(dp, -1, sizeof dp);
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}
	for (int i = N - 1; i >= 0; i--)
		for (int j = N - 1; j >= 0; j--)
			solve(i, j, 1), solve(i, j, 0);
	if (n == m && mi == 0)
		return cout << 1 << endl, 0;
	if (n == m && mi != 0)
		return cout << 0 << endl, 0;
	int ans = 0;
	pre();
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			ll temp = ncr[i][j];
			temp = (temp * 1ll * solve(i - j, 0, 0)) % mod;
			if (!temp)
				continue;
			temp = (temp * 1ll * solve(n - m - i, j + ma, 1)) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	dp[0][0] = 1;
	for (int i = 1; i < N; i++)
	{
		for (int j = 0; j < N; j++)
		{
			add(dp[i][j], dp[i - 1][j + 1]);
			if (j)
				add(dp[i][j], dp[i - 1][j - 1]);
		}
	}
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}
	if (n == m && mi == 0 && ma == 0)
		return cout << 1 << endl, 0;
	if (n == m && (mi != 0 || ma != 0))
		return cout << 0 << endl, 0;
	int ans = 0;
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (j + mi < 0)
				continue;
			ll temp = 1;
			temp = (dp[i][j]) % mod;
			temp = (temp * 1ll * dp[n - m - i][j + ma]) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N][2], ncr[N][N];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
void pre()
{
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (i == j || j == 0)
				ncr[i][j] = 1;
			else
				add(ncr[i][j], ncr[i - 1][j]), add(ncr[i][j], ncr[i - 1][j - 1]);
		}
	}
}
int solve(int ind, int open, bool flag)
{
	if (open >= N)
		return 0;
	if (ind == 0)
	{
		if (flag == 0)
			return open + mi == 0;
		return open == 0;
	}
	int &ret = dp[ind][open][flag];
	if (ret != -1)
		return ret;
	ret = 0;
	if (open > 0)
		add(ret, solve(ind - 1, open - 1, flag));
	add(ret, solve(ind - 1, open + 1, flag));
	return ret;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	memset(dp, -1, sizeof dp);
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}
	for (int i = N - 1; i >= 0; i--)
		for (int j = N - 1; j >= 0; j--)
			solve(i, j, 1), solve(i, j, 0);
	if (n == m && mi == 0 && ma == 0)
		return cout << 1 << endl, 0;
	if (n == m && (mi != 0 || ma != 0))
		return cout << 0 << endl, 0;
	int ans = 0;
	pre();
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if ((i - j - mi) % 2)
				continue;
			int o = (i - j - mi) / 2;
			ll temp = ncr[i - o][j];
			temp = (temp * 1ll * solve(i - j, 0, 0)) % mod;
			if (!temp)
				continue;
//			cout << i << " " << j << " " << ncr[i - o][j] << " "
//					<< solve(i - j, 0, 0) << " " << solve(n - m - i, j + ma, 1)
//					<< endl;
			temp = (temp * 1ll * solve(n - m - i, j + ma, 1)) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
const int N = 2005, mod = (int) 1e9 + 7;
int dp[N][N][2], ncr[N][N];
string s;
int mi = 0;
inline void add(int &a, int b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}
void pre()
{
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			if (i == j || j == 0)
				ncr[i][j] = 1;
			else
				add(ncr[i][j], ncr[i - 1][j]), add(ncr[i][j], ncr[i - 1][j - 1]);
		}
	}
}
int solve(int ind, int open, bool flag)
{
	if (open >= N)
		return 0;
	if (ind == 0)
	{
		if (flag == 0)
			return open + mi == 0;
		return open == 0;
	}
	int &ret = dp[ind][open][flag];
	if (ret != -1)
		return ret;
	ret = 0;
	if (open > 0)
		add(ret, solve(ind - 1, open - 1, flag));
	add(ret, solve(ind - 1, open + 1, flag));
	return ret;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	memset(dp, -1, sizeof dp);
	cin >> n >> m;
	if (n & 1)
		return cout << 0 << endl, 0;
	cin >> s;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			c++;
		else
			c--;
		mi = min(mi, c);
	}
	int ma = 0, t = 0;
	for (int i = s.size() - 1; i >= 0; i--)
	{
		if (s[i] == '(')
			t++;
		else
			t--;
		ma = max(ma, t);
	}
	for (int i = N - 1; i >= 0; i--)
		for (int j = N - 1; j >= 0; j--)
			solve(i, j, 1), solve(i, j, 0);
	if (n == m && mi == 0 && ma == 0)
		return cout << 1 << endl, 0;
	if (n == m && (mi != 0 || ma != 0))
		return cout << 0 << endl, 0;
	int ans = 0;
	pre();
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= i; j++)
		{
//			if ((i - j - mi) % 2)
//				continue;
			int o = (i - j - mi) / 2;
//			ll temp = ncr[i - o][j];
			ll temp = 1;
			temp = (temp * 1ll * solve(i - j, 0, 0)) % mod;
			if (!temp)
				continue;
//			cout << i << " " << j << " " << ncr[i - o][j] << " "
//					<< solve(i - j, 0, 0) << " " << solve(n - m - i, j + ma, 1)
//					<< endl;
			temp = (temp * 1ll * solve(n - m - i, j + ma, 1)) % mod;
			add(ans, temp);
		}
	}
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;
const int SIZE = 2018;

const ll Mod = 1000 * 1000 * 1000 + 7;
int n, m;
string s;
ll dp[SIZE][SIZE];

int main() {
  cin >> n >> m;
  cin >> s;
  int bal = 0;
  int min_bal = 0;
  for (auto c : s) {
    if (c == '(') {
      bal++;
    } else {
      bal--;
      min_bal = min(min_bal, bal);
    }
  }
  dp[0][0] = 1;
  for (int i = 1; i < SIZE; ++i) {
    for (int q = 0; q < SIZE; ++q) {
      if (q != 0) {
        dp[i][q] += dp[i - 1][q - 1];
        dp[i][q] %= Mod;
      }
      if (q != SIZE - 1) {
        dp[i][q] += dp[i - 1][q + 1];
        dp[i][q] %= Mod;
      }
    }
  }
  ll ans = 0;
  for (int startl = 0; startl <= n - m; ++startl) {
    for (int startb = 0; startb < SIZE; ++startb) {
      if (startb + min_bal < 0) {
        continue;
      }
      if (start + bal >= SIZE) {
        continue;
      }
      int finl = n - m - startl;
      int finb = startb + bal;
      ans = (ans + dp[startl][startb] * dp[finl][finb]) % Mod;
    }
  }
  cout << ans << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;
const int SIZE = 2018;

const ll Mod = 1000 * 1000 * 1000 + 7;
int n, m;
string s;
ll dp[SIZE][SIZE];

int main() {
  cin >> n >> m;
  cin >> s;
  int bal = 0;
  int min_bal = 0;
  for (auto c : s) {
    if (c == '(') {
      bal++;
    } else {
      bal--;
      min_bal = min(min_bal, bal);
    }
  }
  dp[0][0] = 1;
  for (int i = 1; i < SIZE; ++i) {
    for (int q = 0; q < SIZE; ++q) {
      if (q != 0) {
        dp[i][q] += dp[i - 1][q - 1];
        dp[i][q] %= Mod;
      }
      if (q != SIZE - 1) {
        dp[i][q] += dp[i - 1][q + 1];
        dp[i][q] %= Mod;
      }
    }
  }
  ll ans = 0;
  for (int startl = 0; startl <= n - m; ++startl) {
    for (int startb = 0; startb < SIZE; ++startb) {
      if (startb + min_bal < 0) {
        continue;
      }
      if (start + bal >= SIZE) {

      }
      int finl = n - m - startl;
      int finb = startb + bal;
      ans = (ans + dp[startl][startb] * dp[finl][finb]) % Mod;
    }
  }
  cout << ans << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;
const int SIZE = 2018;

const ll Mod = 1000 * 1000 * 1000 + 7;
int n, m;
string s;
ll dp[SIZE][SIZE];

int main() {
  cin >> n >> m;
  cin >> s;
  int bal = 0;
  int min_bal = 0;
  for (auto c : s) {
    if (c == '(') {
      bal++;
    } else {
      bal--;
      min_bal = min(min_bal, bal);
    }
  }
  dp[0][0] = 1;
  for (int i = 1; i < SIZE; ++i) {
    for (int q = 0; q < SIZE; ++q) {
      if (q != 0) {
        dp[i][q] += dp[i - 1][q - 1];
        dp[i][q] %= Mod;
      }
      if (q != SIZE - 1) {
        dp[i][q] += dp[i - 1][q + 1];
        dp[i][q] %= Mod;
      }
    }
  }
  ll ans = 0;
  for (int startl = 0; startl <= n - m; ++startl) {
    for (int startb = 0; startb < SIZE; ++startb) {
      if (startb + min_bal < 0) {
        continue;
      }
      if (startb + bal >= SIZE) {
        continue;
      }
      int finl = n - m - startl;
      int finb = startb + bal;
      ans = (ans + dp[startl][startb] * dp[finl][finb]) % Mod;
    }
  }
  cout << ans << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;
const int SIZE = 2018;

const ll Mod = 1000 * 1000 * 1000 + 7;
int n, m;
string s;
ll dp[SIZE][SIZE];

int main() {
  cin >> n >> m;
  cin >> s;
  int bal = 0;
  int min_bal = 0;
  for (auto c : s) {
    if (c == '(') {
      bal++;
    } else {
      bal--;
      min_bal = min(min_bal, bal);
    }
  }
  dp[0][0] = 1;
  for (int i = 1; i < SIZE; ++i) {
    for (int q = 0; q < SIZE; ++q) {
      if (q != 0) {
        dp[i][q] += dp[i - 1][q - 1];
      }
      if (q != SIZE - 1) {
        dp[i][q] += dp[i - 1][q + 1];
      }
    }
  }
  ll ans = 0;
  for (int startl = 0; startl <= n - m; ++startl) {
    for (int startb = 0; startb < SIZE; ++startb) {
      if (startb + min_bal < 0) {
        continue;
      }
      int finl = n - m - startl;
      int finb = startb + bal;
      ans = (ans + dp[startl][startb] * dp[finl][finb]) % Mod;
    }
  }
  cout << ans << endl;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll a)
{
    ll& res = dp[l][a];
    if (res > -1) return res;

    if (l == 0) return res = 1;
    if (l == a) return res = 1;
    if (a < l-a) return res = 0;

    res = 0;
    if (a > 0) (res += calc(l-1, a-1)) %= MOD;
    (res += calc(l-1, a)) %= MOD;
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int d = n-m, op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int a = 0; a <= d; ++a) {
        for (int b = 0; b <= a; ++b) {
            int x = n/2-op-a;
            int y = n/2-cl-b;
            if (x < 0 || y < 0) continue;
            if (a+op < b+cl) continue;
            //cout << a << " " << b << " " << calc(a+b, a) << endl;
            //cout << x << " " << y << " " << calc(x+y, a+op-b-cl+x) << endl;
            res += (calc(a+b, a)*calc(x+y, a+op-b-cl+x))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll a)
{
    ll& res = dp[l][a];
    if (res > -1) return res;

    if (l <= a) return res = 1;
    if (a < l-a) return res = 0;

    res = 0;
    if (a > 0) res += calc(l-1, a-1);
    res += calc(l-1, a);
    res %= MOD;
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int d = n-m, op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int a = 0; a <= d; ++a) {
        for (int b = 0; b <= a; ++b) {
            int x = n/2-op-a;
            int y = n/2-cl-b;
            if (x < 0 || y < 0) continue;
            if (a+op < b+cl) continue;
            //cout << a << " " << b << " " << calc(a+b, a) << endl;
            //cout << x << " " << y << " " << calc(x+y, a+op-b-cl+x) << endl;
            res += (calc(a+b, a)*calc(x+y, a+op-b-cl+x))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<memory.h>
using namespace std;

const int mod = 1e9+7;
int dp[2001][2001];

int f(int len,int big)
{
    if(big>len) return 0;
    if(big<0) return 0;
    if(len==0) return big==0;
    if(~dp[len][big]) return dp[len][big];
    return dp[len][big]=(f(len-1,big-1)+f(len-1,big+1))%mod;
}
char str[100010];
int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
    memset(dp,-1,sizeof(dp));
    scanf("%s",str);
    int len=strlen(str);
    int left=0,right=0,lim=0;
    for(int i=0;i<len;i++)
    {
        if(str[i]=='(') left++;
        else right++;
        if(right>left) lim=max(lim,right-left);
    }
    long long ans=0;
    for(int i=0;i<=n-m;i++) // length
    {
        for(int j=lim;j<=i;j++)
        {
            ans += ((long long)f(i,j) * f(n-m-i, j+left-right))%mod;
            ans%=mod;
        }
    }
    printf("%I64d",ans);
    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll a)
{
    ll& res = dp[l][a];
    if (res > -1) return res;

    if (l == a) return res = 1;
    if (a < l-a) return res = 0;

    res = 0;
    if (a > 0) res += calc(l-1, a-1);
    res += calc(l-1, a);
    res %= MOD;
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int d = n-m, op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int a = 0; a <= d; ++a) {
        for (int b = 0; b <= a; ++b) {
            int x = n/2-op-a;
            int y = n/2-cl-b;
            if (x < 0 || y < 0) continue;
            if (a+op < b+cl) continue;
            //cout << a << " " << b << " " << calc(a+b, a) << endl;
            //cout << x << " " << y << " " << calc(x+y, a+op-b-cl+x) << endl;
            res += (calc(a+b, a)*calc(x+y, a+op-b-cl+x))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll k) // length, openness
{
    if (k < 0) return 0;
    if (k > l) return 0;
    if (l == 0) return k == 0;

    ll& res = dp[l][k];
    if (res > -1) return res;
    res = 0;
    (res += calc(l-1, k-1)) %= MOD; // open
    (res += calc(l-1, k+1)) %= MOD; // close
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int d = n-m, op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int l = 0; l <= d; ++l) {
        for (int k = 0; k <= l; ++k) {
            int r = k+op-cl;
            if (r < 0) continue;
            res += (calc(l, k)*calc(n-m-l, r))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll k) // length, openness
{
    if (k < 0) return 0;
    if (k > l) return 0;
    if (l == 0) return k == 0;

    ll& res = dp[l][k];
    if (res > -1) return res;
    res = 0;
    if (k > 0) (res += calc(l-1, k-1)) %= MOD; // open
    (res += calc(l-1, k+1)) %= MOD; // close
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int d = n-m, op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int l = 0; l <= d; ++l) {
        for (int k = 0; k <= l; ++k) {
            int r = k+op-cl;
            if (r < 0) continue;
            res += (calc(l, k)*calc(n-m-l, r))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll a)
{
    ll& res = dp[l][a];
    if (res > -1) return res;

    if (l == 0) return res = 1;
    if (l == a) return res = 1;
    if (a < l-a) return res = 0;

    res = 0;
    if (a > 0) res += calc(l-1, a-1);
    res += calc(l-1, a);
    res %= MOD;
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int d = n-m, op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int a = 0; a <= d; ++a) {
        for (int b = 0; b <= a; ++b) {
            int x = n/2-op-a;
            int y = n/2-cl-b;
            if (x < 0 || y < 0) continue;
            if (a+op < b+cl) continue;
            //cout << a << " " << b << " " << calc(a+b, a) << endl;
            //cout << x << " " << y << " " << calc(x+y, a+op-b-cl+x) << endl;
            res += (calc(a+b, a)*calc(x+y, a+op-b-cl+x))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll k) // length, openness
{
    if (k < 0) return 0;
    if (k > l) return 0;
    if (l == 0) return k == 0;

    ll& res = dp[l][k];
    if (res > -1) return res;
    res = 0;
    (res += calc(l-1, k-1)) %= MOD; // open
    (res += calc(l-1, k+1)) %= MOD; // close
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int l = 0; l <= n-m; ++l) {
        for (int k = max(0, cl-op); k <= l; ++k) {
            int r = k+op-cl;
            if (r < 0) continue;
            res += (calc(l, k)*calc(n-m-l, r))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll k)
{
    ll& res = dp[l][k];
    if (res > -1) return res;
    if (l == 0) {
        if (k == 0) return res = 1;
        else return res = 0;
    }

    res = 0;
    if (k > 0) (res += calc(l-1, k-1)) %= MOD; // open
    (res += calc(l-1, k+1)) %= MOD; // close
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int d = n-m, op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int l = 0; l <= d; ++l) {
        for (int k = 0; k <= l; ++k) {
            int r = k+op-cl;
            if (r < 0) continue;
            res += (calc(l, k)*calc(n-m-l, r))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll k) // length, openness
{
    if (k < 0) return 0;
    if (k > l) return 0;
    if (l == 0) return k == 0;

    ll& res = dp[l][k];
    if (res > -1) return res;
    res = 0;
    (res += calc(l-1, k-1)) %= MOD; // open
    (res += calc(l-1, k+1)) %= MOD; // close
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int op = 0, cl = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int l = 0; l <= n-m; ++l) {
        for (int k = op-cl; k <= l; ++k) {
            int r = k+op-cl;
            if (r < 0) continue;
            res += (calc(l, k)*calc(n-m-l, r))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int INF = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
#define mp make_pair
#define endl '\n'

const int MOD = 1e9+7;
ll dp[2007][2007];

ll calc(ll l, ll k) // length, openness
{
    if (k < 0) return 0;
    if (k > l) return 0;
    if (l == 0) return k == 0;

    ll& res = dp[l][k];
    if (res > -1) return res;
    res = 0;
    (res += calc(l-1, k-1)) %= MOD; // open
    (res += calc(l-1, k+1)) %= MOD; // close
    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    int op = 0, cl = 0, st = 0;
    for (auto e : s)  {
        if (e == '(') ++op;
        else ++cl;
        if (cl > op) st = max(st, cl-op);
    }

    ll res = 0;
    memset(dp, -1, sizeof(dp));
    for (int l = 0; l <= n-m; ++l) {
        for (int k = st; k <= l; ++k) {
            int r = k+op-cl;
            if (r < 0) continue;
            res += (calc(l, k)*calc(n-m-l, r))%MOD;
            res %= MOD;
        }
    }
    cout << res << endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 5004;

char s[MAXN];
int n, m, b, mb;
ll mdp[MAXN][MAXN];

ll dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j > i || i <= 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    ll ans = dp(i - 1, j - 1) + dp(i - 1, j + 1);
    if (ans > modn) ans -= modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    memset(mdp, -1, sizeof mdp);

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    ll ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += dp(i, j) * dp(n - m - i, j + b);
                ans %= modn;
            }

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 3004;

char s[MAXN];
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || j > i) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = (dp(i - 1, j - 1) + dp(i - 1, j + 1)) % modn;
    return mdp[i][j] = ans;
}

int main() {
    int n, m, b = 0, mb = inf;
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }
    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 3004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || j > i) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = (dp(i - 1, j - 1) + dp(i - 1, j + 1)) % modn;
    return mdp[i][j] = ans;
}

int main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    /*for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;*/
    memset(mdp, -1, sizeof mdp);

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }
    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 3004;

char s[MAXN];
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || j > i) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = ((dp(i - 1, j - 1) % modn) + (dp(i - 1, j + 1) % modn)) % modn;
    return mdp[i][j] = ans;
}

int main() {
    int n, m, b = 0, mb = inf;
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += ((dp(i, j) % modn) * (dp(n - m - i, j + b) % modn)) % modn;
                ans %= modn;
            }
    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 3004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || i < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = ((dp(i - 1, j - 1) % modn) + (dp(i - 1, j + 1) % modn)) % modn;
    return mdp[i][j] = ans;
}

int main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }

    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define int ll

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 5004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || i < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = ((dp(i - 1, j - 1) % modn) + (dp(i - 1, j + 1) % modn)) % modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %lld %lld", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 3004;

char s[MAXN];
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || j > i) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = (dp(i - 1, j - 1) + dp(i - 1, j + 1)) % modn;
    return mdp[i][j] = ans;
}

int main() {
    int n, m, b = 0;
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }
    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define int ll

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 7004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || i < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = ((dp(i - 1, j - 1) % modn) + (dp(i - 1, j + 1) % modn)) % modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }

    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define int ll

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 10004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || i < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = ((dp(i - 1, j - 1) % modn) + (dp(i - 1, j + 1) % modn)) % modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }

    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 3004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || i < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = (dp(i - 1, j - 1) + dp(i - 1, j + 1)) % modn;
    return mdp[i][j] = ans;
}

int main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }
    printf("%d\n", ans);
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 2004;

char s[1000006];
int n, m, b, mb;
ll mdp[MAXN][MAXN];

ll dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j > i || i <= 0 || j < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    ll ans = dp(i - 1, j - 1) + dp(i - 1, j + 1);
    if (ans > modn) ans -= modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    memset(mdp, -1, sizeof mdp);

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    ll ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += dp(i, j) * dp(n - m - i, j + b);
                ans %= modn;
            }

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define int ll

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 3004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || i < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = ((dp(i - 1, j - 1) % modn) + (dp(i - 1, j + 1) % modn)) % modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }

    printf("%d\n", ans);
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define int ll

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 5004;

char s[MAXN];
int n, m, b, mb;
int mdp[MAXN][MAXN];

int dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j < 0 || i < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    int ans = ((dp(i - 1, j - 1) % modn) + (dp(i - 1, j + 1) % modn)) % modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    for (int i = 0; i <= n - m + 10; i++)
        for (int j = 0; j <= n - m + 10; j++)
            mdp[i][j] = -1;

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    int ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += (dp(i, j) * dp(n - m - i, j + b)) % modn;
                ans %= modn;
            }

    printf("%d\n", ans);
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int modn = 1000000007;
/////////////////0123456789
const int MAXN = 2004;

char s[MAXN];
int n, m, b, mb;
ll mdp[MAXN][MAXN];

ll dp(int i, int j) {
    if (i == 0 && j == 0) return 1;
    if (j > i || i <= 0 || j < 0) return 0;
    if (mdp[i][j] != -1) return mdp[i][j];
    ll ans = dp(i - 1, j - 1) + dp(i - 1, j + 1);
    if (ans > modn) ans -= modn;
    return mdp[i][j] = ans;
}

main() {
    scanf(" %d %d", &n, &m);
    scanf(" %s", s);

    memset(mdp, -1, sizeof mdp);

    for (int i = 0; i < m; i++) {
        if (s[i] == '(') b++;
        else b--;
        mb = min(b, mb);
    }

    ll ans = 0;
    for (int i = 0; i <= n - m; i++)
        for (int j = 0; j <= i; j++)
            if (j + mb >= 0 && j + b <= n - m && j + b >= 0) {
                ans += dp(i, j) * dp(n - m - i, j + b);
                ans %= modn;
            }

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MSET(a,i) memset(a,i,sizeof(a))

const int N = 2e3+1;
const int mod = 1e9+7;

int dp[N][N];

void solve(int i)
{
	if(i == N)
		return;
	if(i > 1)
	{
		for (int j = 0; j <= i ; j++)
		{
			dp[i][j] = (dp[i-1][j-1]  + dp[i-1][j+1]) % mod;
		}
	}
	solve(i+1);
}

int main()
{
	MSET(dp,0);
	dp[0][0] = 1;
	dp[1][1] = 1;
	int n,m;
	cin >> n >> m;
	string str;
	cin >> str;
	solve(1);
	int CT = 0;
	for (int i = 0; i < str.size(); ++i)
	{
		if(str[i] == '(')
			CT++;
		else
			CT--;
	}
	// for (int i = 0; i < 5; ++i)
	// {
	// 	for (int j = 0; j < 5; ++j)
	// 	{
	// 		cout << dp[i][j] << ' ';
	// 	}
	// 	cout << endl;
	// }
	if(abs(CT) > n-m)
		cout << "0\n";
	else
	{
		ll ans = 0;
		int ct = abs(CT);
		for (int i = 0; i <= n-m; ++i)
		{
			for (int j = 0; j <= ct; ++j)
			{
				if(CT+j >= 0)
					ans += (dp[i][j] * dp[n-m-i][CT+j]) % mod;
				ans %= mod;
			}
			// cout << ans << endl;
		}
		cout << ans << endl;
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MSET(a,i) memset(a,i,sizeof(a))

const int N = 2e3+1;
const int MOD = 1e9+7;

ll dp[N][N];

void solve(int i)
{
	if(i == N)
		return;
	if(i > 1)
	{
		for (int j = 0; j <= i ; j++)
		{
			dp[i][j] = 0;
			if(j)
				dp[i][j] += (dp[i-1][j-1]) % MOD;
			if(j < N-1)
				dp[i][j] += (dp[i-1][j+1]) % MOD;
			dp[i][j] %= MOD;
		}
	}
	solve(i+1);
}

int main()
{
	MSET(dp,0);
	dp[0][0] = 1;
	dp[1][1] = 1;
	// int t;
	// cin >> t;
	// while(t--){
	int n,m;
	cin >> n >> m;
	string str;
	cin >> str;
	solve(1);
	int CT = 0;
	int minCT = 100000;
	for (int i = 0; i < str.size(); ++i)
	{
		if(str[i] == '(')
			CT++;
		else
			CT--;
		minCT = min(minCT , CT);
	}
	// for (int i = 0; i < 5; ++i)
	// {
	// 	for (int j = 0; j < 5; ++j)
	// 	{
	// 		cout << dp[i][j] << ' ';
	// 	}
	// 	cout << endl;
	// }
	if(abs(CT) > n-m)
		cout << "0\n";
	else
	{
		ll ans = 0;
		int ct = abs(CT);
		for (int i = 0; i <= n-m; ++i)
		{
			for (int j = 0; CT+j < N; ++j)
			{
				// cout << i << ' ' << j << ' ' << dp[i][j] << endl;
				if(minCT+j >= 0)
					ans += (dp[i][j] * dp[n-m-i][CT+j]) % MOD;
				ans %= MOD;
			}
			// cout << i << ' ' << ans << endl;
		}
		cout << ans << endl;
	}
	// }
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MSET(a,i) memset(a,i,sizeof(a))

const int N = 2e3+1;
const int MOD = 1e9+7;

ll dp[N][N];

void solve(int i)
{
	if(i == N)
		return;
	if(i > 1)
	{
		for (int j = 0; j <= i ; j++)
		{
			dp[i][j] = 0;
			if(j)
				dp[i][j] = (dp[i-1][j-1]) % MOD;
			if(j < i)
				dp[i][j] += (dp[i-1][j+1]) % MOD;
			dp[i][j] %= MOD;
		}
	}
	solve(i+1);
}

int main()
{
	MSET(dp,0);
	dp[0][0] = 1;
	dp[1][1] = 1;
	// int t;
	// cin >> t;
	// while(t--){
	int n,m;
	cin >> n >> m;
	string str;
	cin >> str;
	solve(1);
	int CT = 0;
	int minCT = 10000;
	for (int i = 0; i < str.size(); ++i)
	{
		if(str[i] == '(')
			CT++;
		else
			CT--;
		minCT = min(minCT , CT);
	}
	// for (int i = 0; i < 5; ++i)
	// {
	// 	for (int j = 0; j < 5; ++j)
	// 	{
	// 		cout << dp[i][j] << ' ';
	// 	}
	// 	cout << endl;
	// }
	if(abs(CT) > n-m)
		cout << "0\n";
	else
	{
		ll ans = 0;
		int ct = abs(CT);
		for (int i = 0; i <= n-m; ++i)
		{
			for (int j = 0; CT+j < N; ++j)
			{
				// cout << i << ' ' << j << ' ' << dp[i][j] << endl;
				if(minCT+j >= 0)
					ans += (dp[i][j] * dp[n-m-i][CT+j]) % MOD;
				ans %= MOD;
			}
			// cout << i << ' ' << ans << endl;
		}
		cout << ans << endl;
	}
	// }
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MSET(a,i) memset(a,i,sizeof(a))

const int N = 2e3+1;
const int mod = 1e9+7;

int dp[N][N];

void solve(int i)
{
	if(i == N)
		return;
	if(i > 1)
	{
		for (int j = 0; j <= i ; j++)
		{
			dp[i][j] = (dp[i-1][j-1]  + dp[i-1][j+1]) % mod;
		}
	}
	solve(i+1);
}

int main()
{
	MSET(dp,0);
	dp[0][0] = 1;
	dp[1][1] = 1;
	int n,m;
	cin >> n >> m;
	string str;
	cin >> str;
	solve(1);
	int CT = 0;
	for (int i = 0; i < str.size(); ++i)
	{
		if(str[i] == '(')
			CT++;
		else
			CT--;
	}
	// for (int i = 0; i < 5; ++i)
	// {
	// 	for (int j = 0; j < 5; ++j)
	// 	{
	// 		cout << dp[i][j] << ' ';
	// 	}
	// 	cout << endl;
	// }
	if(abs(CT) > n-m)
		cout << "0\n";
	else
	{
		ll ans = 0;
		int ct = abs(CT);
		for (int i = 0; i <= n-m; ++i)
		{
			for (int j = 0; j <= ct; ++j)
			{
				ans += (dp[i][j] * dp[n-m-i][CT+j]) % mod;
				ans %= mod;
			}
			// cout << ans << endl;
		}
		cout << ans << endl;
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MSET(a,i) memset(a,i,sizeof(a))

const int N = 2e3+1;
const int MOD = 1e9+7;

ll dp[N][N];

void solve(int i)
{
	if(i == N)
		return;
	if(i > 1)
	{
		for (int j = 0; j <= i ; j++)
		{
			dp[i][j] = (dp[i-1][j-1]  + dp[i-1][j+1]) % MOD;
		}
	}
	solve(i+1);
}

int main()
{
	MSET(dp,0);
	dp[0][0] = 1;
	dp[1][1] = 1;
	int n,m;
	cin >> n >> m;
	string str;
	cin >> str;
	solve(1);
	int CT = 0;
	for (int i = 0; i < str.size(); ++i)
	{
		if(str[i] == '(')
			CT++;
		else
			CT--;
	}
	// for (int i = 0; i < 5; ++i)
	// {
	// 	for (int j = 0; j < 5; ++j)
	// 	{
	// 		cout << dp[i][j] << ' ';
	// 	}
	// 	cout << endl;
	// }
	if(abs(CT) > n-m)
		cout << "0\n";
	else
	{
		ll ans = 0;
		int ct = abs(CT);
		for (int i = 0; i <= n-m; ++i)
		{
			for (int j = 0; CT+j <= i; ++j)
			{
				if(CT+j >= 0)
					ans += (dp[i][j] * dp[n-m-i][CT+j]) % MOD;
				ans %= MOD;
			}
			// cout << ans << endl;
		}
		cout << ans << endl;
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char *target = "abacaba";
const int target_len = 7;

int string_match(char *a, char *b) {
  int match = 1;
  for (; *b != '\0'; a++, b++) {
    if (*a != *b || *a == '\0') {
      match = 0;
      break;
    }
  }
  return match;
}

int main(void) {
  int t;
  scanf("%d", &t);

  for (; t > 0; t--) {
    int n;
    scanf("%d", &n);

    char *s = malloc((n + 1) * sizeof(*s));
    scanf("%s", s);

    char *tmp = malloc((n + 1) * sizeof(*tmp));

    int success = 0;

    // brute force
    for (int i = 0; i < n; i++) {
      char c = s[i];
      if (c == 'a' || c == '?') {
        strcpy(tmp, s);

        int target_exists = 1;

        // set ? before c to d
        // try to finish abacaba
        // after abacaba, set all ? to d
        for (int j = 0; j < n; j++) {
          if ((j < i || j >= i + target_len)) {
            if (tmp[j] == '?') {
              tmp[j] = 'd';
            }
          } else {
            if (tmp[j] == '?') {
              tmp[j] = target[j - i];
            }
            if (tmp[j] != target[j - i]) {
              target_exists = 0;
              break;
            }
          }
        }

        // if unable to create abacaba starting at i, look for another answer
        if (!target_exists) {
          continue;
        }

        // count abacaba instances
        int count_match = 0;
        for (int j = 0; j < n; j++) {
          if (tmp[j] == 'a') {
            if (string_match(&tmp[j], target)) {
              count_match++;
            }
          }
        }

        // if multiple exists, continue looking for an answer
        if (count_match > 1) {
          continue;
        }

        // answer found
        success = 1;
        break;
      }
    }

    if (success) {
      printf("Yes\n%s\n", tmp);
    } else {
      printf("No\n");
    }

    free(s);
    free(tmp);
  }

  return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char *target = "abacaba";
const int target_len = 7;

int string_match(char *a, char *b) {
  int match = 1;
  for (; *b != '\0'; a++, b++) {
    if (*a != *b) {
      match = 0;
      break;
    }
  }
  return match;
}

int main(void) {
  int t;
  scanf("%d", &t);

  for (; t > 0; t--) {
    int n;
    scanf("%d", &n);

    char *s = malloc((n + 1) * sizeof(*s));
    scanf("%s", s);

    char *tmp = malloc((n + 1) * sizeof(*tmp));

    int success = 0;

    // brute force
    for (int i = 0; i < n; i++) {
      char c = s[i];
      if (c == 'a' || c == '?') {
        strcpy(tmp, s);

        int target_exists = 1;

        // set ? before c to d
        // try to finish abacaba
        // after abacaba, set all ? to d
        for (int j = 0; j < n; j++) {
          if ((j < i || j >= i + target_len)) {
            if (tmp[j] == '?') {
              tmp[j] = 'd';
            }
          } else {
            if (tmp[j] == '?') {
              tmp[j] = target[j - i];
            }
            if (tmp[j] != target[j - i]) {
              target_exists = 0;
              break;
            }
          }
        }

        // if unable to create abacaba starting at i, look for another answer
        if (!target_exists) {
          continue;
        }

        // count abacaba instances
        int count_match = 0;
        for (int j = 0; j < n; j++) {
          if (tmp[j] == 'a') {
            if (string_match(&tmp[j], target)) {
              count_match++;
            }
          }
        }

        // if multiple exists, continue looking for an answer
        if (count_match > 1 || count_match == 0) {
          continue;
        }

        // answer found
        success = 1;
        break;
      }
    }

    if (success) {
      printf("Yes\n%s\n", tmp);
    } else {
      printf("No\n");
    }

    free(s);
    free(tmp);
  }

  return 0;
}