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: Time Limit Exceeded)

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = int(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = int(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) begin(x), end(x)
#define dump(x) cerr << #x " = " << x << endl
#define unittest_name_helper(counter) unittest_ ## counter
#define unittest_name(counter) unittest_name_helper(counter)
#define unittest __attribute__((constructor)) void unittest_name(__COUNTER__) ()
using ll = long long;
using namespace std;
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
template <class T, class U> inline void chmax(T & a, U const & b) { a = max<T>(a, b); }
template <class T, class U> inline void chmin(T & a, U const & b) { a = min<T>(a, b); }
template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }
template <typename T> ostream & operator << (ostream & out, vector<T> const & xs) { REP (i, int(xs.size()) - 1) out << xs[i] << ' '; if (not xs.empty()) out << xs.back(); return out; }

template <int32_t MOD>
struct mint {
    int64_t value;  // faster than int32_t a little
    mint() = default;  // value is not initialized
    mint(int64_t value_) : value(value_) {}  // assume value is in proper range
    inline mint<MOD> operator + (mint<MOD> other) const { int64_t c = this->value + other.value; return mint<MOD>(c >= MOD ? c - MOD : c); }
    inline mint<MOD> operator - (mint<MOD> other) const { int64_t c = this->value - other.value; return mint<MOD>(c <    0 ? c + MOD : c); }
    inline mint<MOD> operator * (mint<MOD> other) const { int64_t c = this->value * int64_t(other.value) % MOD; return mint<MOD>(c < 0 ? c + MOD : c); }
    inline mint<MOD> & operator += (mint<MOD> other) { this->value += other.value; if (this->value >= MOD) this->value -= MOD; return *this; }
    inline mint<MOD> & operator -= (mint<MOD> other) { this->value -= other.value; if (this->value <    0) this->value += MOD; return *this; }
    inline mint<MOD> & operator *= (mint<MOD> other) { this->value = this->value * int64_t(other.value) % MOD; if (this->value < 0) this->value += MOD; return *this; }
    inline mint<MOD> operator - () const { return mint<MOD>(this->value ? MOD - this->value : 0); }
    mint<MOD> pow(uint64_t k) const {
        mint<MOD> x = *this, y = 1;
        for (; k; k >>= 1) {
            if (k & 1) y *= x;
            x *= x;
        }
        return y;
    }
    mint<MOD> inv() const { return pow(MOD - 2); }  // MOD must be a prime
    inline mint<MOD> operator /  (mint<MOD> other) const { return *this *  other.inv(); }
    inline mint<MOD> operator /= (mint<MOD> other)       { return *this *= other.inv(); }
    inline bool operator == (mint<MOD> other) const { return value == other.value; }
    inline bool operator != (mint<MOD> other) const { return value != other.value; }
};
template <int32_t MOD> ostream & operator << (ostream & out, mint<MOD> n) { return out << n.value; }

template <int32_t MOD>
mint<MOD> fact(int n) {
    static vector<mint<MOD> > memo(1, 1);
    while (n >= memo.size()) {
        memo.push_back(memo.back() * mint<MOD>(memo.size()));
    }
    return memo[n];
}
template <int32_t PRIME>
mint<PRIME> inv_fact(int n) {
    static vector<mint<PRIME> > memo;
    if (memo.size() <= n) {
        int l = memo.size();
        int r = n * 1.3 + 100;
        memo.resize(r);
        memo[r - 1] = fact<PRIME>(r - 1).inv();
        for (int i = r - 2; i >= l; -- i) {
            memo[i] = memo[i + 1] * (i + 1);
        }
    }
    return memo[n];
}

template <int32_t MOD>
mint<MOD> choose(int n, int r) {
    assert (0 <= r and r <= n);
    return fact<MOD>(n) * inv_fact<MOD>(n - r) * inv_fact<MOD>(r);
}


/**
 * group = 1:
 *    R
 *
 * group = 2:
 *    _B_
 *    _BR
 *    RB_
 *    RBR
 *
 * group = 4:
 *    _BRBRB_
 *    _BRBRBR
 *    RBRBRB_
 *    RBRBRBR
 */

constexpr int MOD = 1e9 + 7;

bool is_constructible_sequence(int k, string const & s, vector<int> const & f) {
    int r = 0, b = 0;  // indices, 0 <= b <= r <= f.size()
    int q = 0;
    for (char c : s) {
        if (c == 'r' and r < f.size()) {
            ++ r;
        } else if (c == 'b' and b < r) {
            assert (f[b] >= 2);
            q += f[b] - 2;
            ++ b;
        } else if (q) {
            -- q;
        }
        while (b < r and f[b] == 1) {
            ++ b;
        }
    }
    return r == f.size() and b == f.size() and not q;
}

vector<vector<int> > list_constructible_sequences(int n, int k, string const & s) {
    vector<vector<int> > fs;
    vector<int> f;
    function<void (int, int)> go = [&](int used, int group) {
        if (group == 0) {
            if (is_constructible_sequence(k, s, f)) {
                fs.push_back(f);
            }
        } else {
            go(used, group - 1);
            int next_used = used + (not not used) + max(1, 2 * group - 3);
            if (next_used <= n) {
                f.push_back(group);
                go(next_used, group);
                f.pop_back();
            }
        }
    };
    go(0, max(2, n));
    return fs;
}

void initialize_dp(int n, vector<mint<MOD> > & cur) {
    cur.assign(n + 1, 1);
}
void step_dp(int n, int i, int f_i, vector<mint<MOD> > const & prv, vector<mint<MOD> > & cur) {
    cur.assign(n + 1, 0);
    REP (j, n) {
        cur[j + 1] += cur[j];  // use a white ball
        int core = max(1, f_i * 2 - 3);
        REP3 (dj, core, n - j + (i == 0)) {
            mint<MOD> cnt = 0;
            if (f_i == 1) {
                cnt += 1;
            } else {
                for (int size : { core, core + 1, core + 1, core + 2 }) {
                    if (dj >= size) {
                        cnt += choose<MOD>(dj - 1, size - 1);
                    }
                }
            }
            cur[j + (i != 0) + dj] += cnt * prv[j];  // use red and blue balls (after a white ball)
        }
    }
}
mint<MOD> get_dp_result(int n, vector<mint<MOD> > const & cur) {
    return cur[n];
}

mint<MOD> count_shuffled_sequence(vector<int> const & f) {
    mint<MOD> acc = 1;
    for (int l = 0; l < f.size(); ) {
        int r = l;
        while (r < f.size() and f[l] == f[r]) ++ r;
        acc *= choose<MOD>(r, r - l);
        l = r;
    }
    return acc;
}

mint<MOD> solve(int n, int k, string const & s) {
    mint<MOD> acc = 0;
    auto fs = list_constructible_sequences(n, k, s);
    sort(ALL(fs));
    auto dp = vectors(n + 1, n + 1, mint<MOD>());
    initialize_dp(n, dp[0]);
    vector<int> prv_f;
    for (auto const & cur_f : fs) {
        int i = 0;
        while (i < prv_f.size() and i < cur_f.size() and prv_f[i] == cur_f[i]) {
            ++ i;
        }
        while (i < cur_f.size()) {
            step_dp(n, i, cur_f[i], dp[i], dp[i + 1]);
            ++ i;
        }
        acc += get_dp_result(n, dp[cur_f.size()]) * count_shuffled_sequence(cur_f);
        prv_f = cur_f;
    }
    return acc;
}

int main() {
    int n, k; cin >> n >> k;
    string s; cin >> s;
    cout << solve(n, k, s).value << endl;
    return 0;
}