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: Wrong Answer)

#include<cstdio>
#define N 150
#define p 1000000007
#define ll long long
int a[N],b[N],c[N],d[N],e[N],m,n,x,y;char s[N];bool t[N];
inline bool solve(int z)
{
    int i,j,k;
    for(i=1;i<=m;i++)t[i]=false;
    for(i=j=1;i<=y;d[i]=c[i]<2?0:c[i]-2,i++)i==y||c[i]!=c[i+1]?z=(ll)b[i-j+1]*z%p,j=i+1:0;
    for(i=1,j=k=y;i<=m;i++)
    if(s[i]=='r'&&c[j]>1)t[i]=true,j--;
    else if(s[i]=='b'&&j<k&&c[k]>1)t[e[k--]=i]=true;
    else if(s[i]=='r'&&c[j]==1)t[e[j--]=i]=true;
    if(j||c[k]>1)return false;
    for(i=1,j=y;i<=m&&j;!t[i]&&e[j]<i?d[j]--:0,i++)while(j&&!d[j])j--;
    while(j&&!d[j])j--;
    if(j)return false;
    return x=(x+(ll)z*a[y])%p,true;
}
void dfs(int u,int v,int w){if(solve((ll)a[v]*b[w]%p*b[v-w]%p))for(int i=u;0<=v-w-(i==1?2:i-1<<1);i++)dfs(c[++y]=i,v+(i==1?0:2),w+(i<<1)),y--;}
int main()
{
    scanf("%d%d%s",&n,&m,s+1),*a=a[1]=*b=b[1]=1;
    for(int i=2;i<=(n<<1|1);i++)a[i]=(ll)a[i-1]*i%p,b[i]=(ll)(p-p/i)*b[p%i]%p;
    for(int i=2;i<=(n<<1|1);i++)b[i]=(ll)b[i]*b[i-1]%p;
    dfs(1,n+1,0),printf("%d\n",x);
    return 0;
}