Problem:
Score : 1100 points

Problem Statement

There are N white balls arranged in a row, numbered 1,2,..,N from left to right.
AtCoDeer the deer is thinking of painting some of these balls red and blue, while leaving some of them white.

You are given a string s of length K.
AtCoDeer performs the following operation for each i from 1 through K in order:

The i-th operation: Choose a contiguous segment of balls (possibly empty), and paint these balls red if the i-th character in s is r; paint them blue if the character is b.

Here, if a ball which is already painted is again painted, the color of the ball will be overwritten.
However, due to the properties of dyes, it is not possible to paint a white, unpainted ball directly in blue.
That is, when the i-th character in s is b, the chosen segment must not contain a white ball.

After all the operations, how many different sequences of colors of the balls are possible?
Since the count can be large, find it modulo 10^9+7.

Constraints

1 ≤ N ≤ 70

1 ≤ K ≤ 70

|s| = K

s consists of r and b.

N and K are integers.

Input

Input is given from Standard Input in the following format:

N K
s

Output

Print the number of the different possible sequences of colors of the balls after all the operations, modulo 10^9+7.

Sample Input 1

2 2
rb

Sample Output 1

9

There are nine possible sequences of colors of the balls, as follows:

ww, wr, rw, rr, wb, bw, bb, rb, br.

Here, r represents red, b represents blue and wrepresents white.

Sample Input 2

5 2
br

Sample Output 2

16

Since we cannot directly paint white balls in blue, we can only choose an empty segment in the first operation.

Sample Input 3

7 4
rbrb

Sample Output 3

1569

Sample Input 4

70 70
bbrbrrbbrrbbbbrbbrbrrbbrrbbrbrrbrbrbbbbrbbrbrrbbrrbbbbrbbrbrrbbrrbbbbr

Sample Output 4

841634130

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include<bits/stdc++.h>
typedef long long ll;
#define mod 1000000007
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
std::mt19937 rnd(time(NULL));
#define rand rnd
#define pr std::pair<int,int>
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
template<class T>void cxk(T&a,T b){a=a>b?a:b;}
template<class T>void cnk(T&a,T b){a=a<b?a:b;}
#ifdef mod
int pow(int x,int y){
	int ret=1;
	while(y){
		if(y&1)ret=1ll*ret*x%mod;
		x=1ll*x*x%mod;y>>=1;
	}
	return ret;
}
template<class Ta,class Tb>void inc(Ta&a,Tb b){a=a+b>=mod?a+b-mod:a+b;}
template<class Ta,class Tb>void dec(Ta&a,Tb b){a=a>=b?a-b:a+mod-b;}
#endif
int f[2][72][72],t;
//f[i][j][k]
//i:上次选的lenb；j:r段数；k:∑b
char S[72];
int to[72],pre[72],Sr[72],fact[1010],ifact[1010];
int C(int n,int m){return 1ll*fact[n]*ifact[n-m]%mod*ifact[m]%mod;}
int Ins(int n,int m){
	if(!m)return 1;
	if(!n)return 0;
	return C(n+m-1,n-1);
}
int main(){
#ifdef LOCAL
	freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);
#endif
	int n=gi(),K=gi(),m=0;
	scanf("%s",S+1);
	for(int i=1;i<=K;++i)Sr[i]=Sr[i-1]+(S[i]=='r');
	for(int i=1,j=1;i<=K;++i)
		if(S[i]=='r'){
			while(j<=K&&(j<=i||S[j]=='r'))++j;
			to[++m]=K-j;if(j>K)to[m]=-1e9;++j;
			pre[m]=Sr[std::min(j,K)-1];
		}
	fact[0]=1;for(int i=1;i<=1000;++i)fact[i]=1ll*fact[i-1]*i%mod;
	ifact[1000]=pow(fact[1000],mod-2);for(int i=1000;i;--i)ifact[i-1]=1ll*ifact[i]*i%mod;
	int ans=1;
	for(int d=1;d<=m&&d<=n;++d){
		for(int o0=0;o0<=m;++o0){
			memset(f,0,sizeof f);
			f[t][o0][0]=ifact[o0];
			for(int i=1;i<=n;++i){
				memset(f[!t],0,sizeof f[!t]);
				for(int j=0;j<=d;++j)
					for(int k=0;k<=n;++k)
						if(f[t][j][k])
							for(int o=0,nj=j,nk=k;nj<=d&&nk<=n;++o,++nj,nk+=i){
								if(o&&to[d-nj+1]-std::max(0,d-pre[d-nj+1])-(nj-1-o0)<nk-nj+o0)break;
								inc(f[!t][nj][nk],1ll*ifact[o]%mod*f[t][j][k]%mod);
							}
				t^=1;
			}
			for(int k=0;k<=n;++k)
				if(f[t][d][k]){
					int res=0;
					for(int p=d-1;p<=n-k*2+d-o0*2;++p)
						inc(res,1ll*f[t][d][k]*Ins(d+1,p-d+1)%mod*Ins(k*2+d,n-k*2+d-p-o0*2)%mod);
					inc(ans,res=1ll*fact[d]*res%mod);
					//fprintf(stderr,"%d %d %d %d %d\n",o0,d,k,f[t][d][k],res);
				}
		}
	}
	printf("%d\n",ans);
	return 0;
}