#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head
const int N=310,O=300;
int s[N],n,cnt,t[N];
char c[N];
bool checkff(int *s) {
rep(i,1,n+1) if (s[i]<0) return 0;
return s[n]==0;
}
bool checkbf() {
if (checkff(s)) return 1;
rep(j,1,n+1) rep(k,j,n+1) {
rep(i,1,n+1) {
t[i]=t[i-1]+((i>=j&&i<=k)?(-1):1)*(s[i]-s[i-1]);
}
if (checkff(t)) {
return 1;
}
}
return 0;
}
bool check() {
if (n%2!=0) return 0;
int prem=0,sufm=s[n],pj=-1,pk=-1;
rep(i,1,n+1) if (s[i]<0) {
pj=i;
break;
} else prem=max(prem,s[i]);
per(i,1,n+1) if (s[i]<s[n]) {
pk=i;
break;
} else sufm=max(sufm,s[i]);
if (pj==-1&&pk==-1) return 1;
if (pj==-1) {
per(i,0,n+1) {
if (2*s[i]==2*sufm-s[n]) return 1;
if (s[i]>2*sufm-s[n]) return 0;
}
assert(0);
}
if (pk==-1) {
rep(i,1,n+1) {
if (2*s[i]==2*prem+s[n]) return 1;
if (s[i]>2*prem) return 0;
}
}
rep(i,1,n+1) printf("%d ",s[i]); puts("");
printf("%d %d\n",pj,pk);
assert(pj<pk);
rep(i,pj,pk+1) if (s[i]>min(2*prem,2*sufm-s[n])) return 0;
return 1;
}
int ret;
int dp1[N][N];
int dpl[N][2*N][N],dpr[N][2*N][N],rel[N][2*N],rer[N][2*N];
void upd(int &a,int b) {
a+=b; if (a>=mod) a-=mod;
}
void solve1() {
dp1[0][0]=1;
rep(i,0,n) rep(j,0,i+1) if (dp1[i][j]) {
if (c[i+1]=='('||c[i+1]=='x') upd(dp1[i+1][j+1],dp1[i][j]);
if ((c[i+1]==')'||c[i+1]=='x')&&j>0) upd(dp1[i+1][j-1],dp1[i][j]);
}
upd(ret,dp1[n][0]);
}
void solve2() {
rep(i,0,n+2) rep(j,-i,i+1) rel[i][j+O]=rer[i][j+O]=0;
// rep(gmx,-1,n+1) {
rep(gmx,-1,n+1) {
rep(i,0,n+2) rep(j,-i,i+1) rep(sta,0,3) dpl[i][j+O][sta]=dpr[i][j+O][sta]=0;
dpl[0][0+O][0>=gmx]=1;
rep(i,0,n) for (int j=-i;j<=i;j+=2) rep(sta,0,3) if (dpl[i][j+O][sta]) {
int val=dpl[i][j+O][sta];
if (c[i+1]=='('||c[i+1]=='x') {
if (sta==0) {
if (2*(j+1)>=gmx) upd(dpl[i+1][j+1+O][1],val);
else upd(dpl[i+1][j+1+O][0],val);
} else if (sta==1) {
upd(dpl[i+1][j+1+O][1],val);
} else {
if (j+1==gmx) upd(rel[i+1][O+gmx],val);
if (j+1<gmx) upd(dpl[i+1][j+1+O][2],val);
}
}
if (c[i+1]==')'||c[i+1]=='x') {
if (sta==0) {
if (j>0) upd(dpl[i+1][j-1+O][0],val);
} else if (sta==1) {
if (j>0) upd(dpl[i+1][j-1+O][1],val);
else {
if (gmx==-1) upd(rel[i+1][O+gmx],val);
else upd(dpl[i+1][j-1+O][2],val);
}
} else {
upd(dpl[i+1][j-1+O][2],val);
}
}
}
dpr[0][0+O][0>=gmx]=1;
rep(i,0,n) for (int j=-i;j<=i;j+=2) rep(sta,0,3) if (dpr[i][j+O][sta]) {
int val=dpr[i][j+O][sta];
if (c[n-i]==')'||c[n-i]=='x') {
if (sta==0) {
if (2*(j+1)>=gmx) upd(dpr[i+1][j+1+O][1],val);
else upd(dpr[i+1][j+1+O][0],val);
} else if (sta==1) {
upd(dpr[i+1][j+1+O][1],val);
} else {
if (j+1==gmx) upd(rer[i+1][O+gmx],val);
if (j+1<=gmx) upd(dpr[i+1][j+1+O][2],val);
}
}
if (c[n-i]=='('||c[n-i]=='x') {
if (sta==0) {
if (j>0) upd(dpr[i+1][j-1+O][0],val);
} else if (sta==1) {
if (j>0) upd(dpr[i+1][j-1+O][1],val);
else {
if (gmx==-1) upd(rer[i+1][O+gmx],val);
upd(dpr[i+1][j-1+O][2],val);
}
} else {
upd(dpr[i+1][j-1+O][2],val);
}
}
}
}
// printf("%d\n",rel[5][1+O]);
rep(gmx,-1,n+1) rep(i,1,n) rep(sn,-n,n+1) if (gmx-sn>=-1&&gmx-sn<=n-i)
upd(ret,(ll)rel[i][gmx+O]*rer[n-i][gmx-sn+O]%mod);
}
int pdl[N][2*N][6];
void solve3() {
for (int gmx=0;gmx<=n;gmx++) for (int sn=-2;sn>=-n;sn-=2) if (gmx+gmx-sn<=n) {
rep(i,0,n+1) for (int j=-i;j<=i;j+=2) rep(sta,0,6) pdl[i][j+O][sta]=0;
pdl[0][O][gmx==0]=1;
rep(i,0,n) for (int j=max(-i,sn+(i&1));j<=i&&j<=sn+n-i;j+=2) rep(sta,0,6) if (pdl[i][j+O][sta]) {
int val=pdl[i][j+O][sta];
if (c[i+1]=='('||c[i+1]=='x') {
if (sta==0) {
if (j+1==gmx) upd(pdl[i+1][j+1+O][1],val);
if (j+1<gmx) upd(pdl[i+1][j+1+O][0],val);
} else if (sta==1) {
if (j+1<=gmx) upd(pdl[i+1][j+1+O][1],val);
} else if (sta==2) {
if (j+1<=2*gmx) upd(pdl[i+1][j+1+O][2],val);
} else if (sta==3) {
if (j+1==gmx) upd(pdl[i+1][j+1+O][4],val);
if (j+1<gmx) upd(pdl[i+1][j+1+O][3],val);
} else if (sta==4) {
if (j+1<=gmx) upd(pdl[i+1][j+1+O][4],val);
} else if (sta==5) {
upd(pdl[i+1][j+1+O][5],val);
}
}
if (c[i+1]==')'||c[i+1]=='x') {
if (j-1<sn) continue;
int w=0;
if ((j-1)==gmx+sn/2&&sta<3) w=3;
if (sta==0) {
if (j>0) upd(pdl[i+1][j-1+O][w],val);
} else if (sta==1) {
if (j>0) upd(pdl[i+1][j-1+O][1+w],val);
else upd(pdl[i+1][j-1+O][2+w],val);
} else if (sta==2) {
upd(pdl[i+1][j-1+O][2+w],val);
} else if (sta==3) {
if (j>0) upd(pdl[i+1][j-1+O][3],val);
} else if (sta==4) {
if (j>0) upd(pdl[i+1][j-1+O][4],val);
else upd(pdl[i+1][j-1+O][5],val);
} else {
upd(pdl[i+1][j-1+O][5],val);
}
}
}
upd(ret,pdl[n][sn+O][5]);
}
for (int gmx=0;gmx<=n;gmx++) for (int sn=-2;sn>=-n;sn-=2) if (gmx+gmx-sn<=n) {
rep(i,0,n+1) for (int j=-i;j<=i;j+=2) rep(sta,0,6) pdl[i][j+O][sta]=0;
pdl[0][O][gmx==0]=1;
rep(i,0,n) for (int j=max(-i,sn+(i&1));j<=i&&j<=sn+n-i;j+=2) rep(sta,0,6) if (pdl[i][j+O][sta]) {
int val=pdl[i][j+O][sta];
if (c[n-i]==')'||c[n-i]=='x') {
if (sta==0) {
if (j+1==gmx) upd(pdl[i+1][j+1+O][1],val);
if (j+1<gmx) upd(pdl[i+1][j+1+O][0],val);
} else if (sta==1) {
if (j+1<=gmx) upd(pdl[i+1][j+1+O][1],val);
} else if (sta==2) {
if (j+1<=2*gmx) upd(pdl[i+1][j+1+O][2],val);
} else if (sta==3) {
if (j+1==gmx) upd(pdl[i+1][j+1+O][4],val);
if (j+1<gmx) upd(pdl[i+1][j+1+O][3],val);
} else if (sta==4) {
if (j+1<=gmx) upd(pdl[i+1][j+1+O][4],val);
} else if (sta==5) {
upd(pdl[i+1][j+1+O][5],val);
}
}
if (c[n-i]=='('||c[n-i]=='x') {
if (j-1<sn) continue;
int w=0;
if ((j-1)==gmx+sn/2&&sta<3) w=3;
if (sta==0) {
if (j>0) upd(pdl[i+1][j-1+O][w],val);
} else if (sta==1) {
if (j>0) upd(pdl[i+1][j-1+O][1+w],val);
else upd(pdl[i+1][j-1+O][2+w],val);
} else if (sta==2) {
upd(pdl[i+1][j-1+O][2+w],val);
} else if (sta==3) {
if (j>0) upd(pdl[i+1][j-1+O][3],val);
} else if (sta==4) {
if (j>0) upd(pdl[i+1][j-1+O][4],val);
else upd(pdl[i+1][j-1+O][5],val);
} else {
upd(pdl[i+1][j-1+O][5],val);
}
}
}
upd(ret,pdl[n][sn+O][5]);
}
}
int main() {
scanf("%d",&n);
scanf("%s",c+1);
// rep(i,1,n+1) c[i]='x';
if (n%2!=0) { puts("0"); return 0; }
solve1();
// printf("%d\n",ret); ret=0;
solve2();
// printf("%d\n",ret); ret=0;
solve3();
// printf("%d\n",ret); ret=0;
printf("%d\n",ret);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgcmVwKGksYSxuKSBmb3IgKGludCBpPWE7aTxuO2krKykKI2RlZmluZSBwZXIoaSxhLG4pIGZvciAoaW50IGk9bi0xO2k+PWE7aS0tKQojZGVmaW5lIHBiIHB1c2hfYmFjawojZGVmaW5lIG1wIG1ha2VfcGFpcgojZGVmaW5lIGFsbCh4KSAoeCkuYmVnaW4oKSwoeCkuZW5kKCkKI2RlZmluZSBmaSBmaXJzdAojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIFNaKHgpICgoaW50KSh4KS5zaXplKCkpCnR5cGVkZWYgdmVjdG9yPGludD4gVkk7CnR5cGVkZWYgbG9uZyBsb25nIGxsOwp0eXBlZGVmIHBhaXI8aW50LGludD4gUElJOwpjb25zdCBsbCBtb2Q9MTAwMDAwMDAwNzsKbGwgcG93bW9kKGxsIGEsbGwgYikge2xsIHJlcz0xO2ElPW1vZDsgYXNzZXJ0KGI+PTApOyBmb3IoO2I7Yj4+PTEpe2lmKGImMSlyZXM9cmVzKmElbW9kO2E9YSphJW1vZDt9cmV0dXJuIHJlczt9CmxsIGdjZChsbCBhLGxsIGIpIH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