Hakone Ekiden is one of the Japanese New Year's traditions. In Hakone Ekiden, 10 runners from each team aim for the goal while connecting the sashes at each relay station. In the TV broadcast, the ranking change from the previous relay station is displayed along with the passing order of each team at the relay station. So, look at it and tell us how many possible passage orders for each team at the previous relay station. The number of possible transit orders can be very large, so answer by the remainder divided by 1,000,000,007.



Input

The input is given in the form:

> n
> c1
> c2
> ...
> cn
>

The number n (1 ≤ n ≤ 200) representing the number of teams is on the first line, and the ranking changes from the previous relay station in order from the first place on the following n lines. If it is'`U`', the ranking is up, if it is'`-`', the ranking is not changed) is written.

Output

Please output in one line by dividing the number of passages that could have been the previous relay station by 1,000,000,007.

Examples

Input

3
-
U
D


Output

1


Input

5
U
U
-
D
D


Output

5


Input

8
U
D
D
D
D
D
D
D


Output

1


Input

10
U
D
U
D
U
D
U
D
U
D


Output

608


Input

2
D
U


Output

0
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007LL;
const int INF = LLONG_MAX;
int dp[210][210][210] = {};

signed main(){
    
    int n; cin >> n;

    // 上から i 番目までみて、左は j 個、右は k 個余ってる時の通り数
    dp[0][0][0] = 1;

    // - は無視
    vector<char> v;
    for(int i = 0; i < n; i++){
        char c; cin >> c;
        if(c == '-') continue;
        v.push_back(c);
    }

    // マッチングの問題に帰着

    n = (int)v.size();

    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            for(int k = 0; k < n; k++){
                if(dp[i][j][k] == 0) continue;

                if(v[i] == 'D'){
                    // 右は j 個のうち一つと必ず結ぶ

                    int mul = 1;
                    // 左をどこかと結ぶ
                    mul *= j;
                    mul %= MOD;
                    mul *= k;
                    mul %= MOD;
                    dp[i + 1][j - 1][k - 1] += dp[i][j][k] * mul;
                    dp[i + 1][j - 1][k - 1] %= MOD;

                    // 左を保留にする
                    mul = 1;
                    mul *= j;
                    mul %= MOD;
                    dp[i + 1][j][k] += dp[i][j][k] * mul;
                    dp[i + 1][j][k] %= MOD;

                }else{

                    // 右は保留確定

                    int mul = 1;
                    // 左をどこかと結ぶ
                    mul *= k;
                    mul %= MOD;
                    dp[i + 1][j][k] += dp[i][j][k] * mul;
                    dp[i + 1][j][k] %= MOD;

                    // 左を保留にする
                    dp[i + 1][j + 1][k + 1] += dp[i][j][k];
                    dp[i + 1][j + 1][k + 1] %= MOD;
                }
            }
        }
    }

    cout << dp[n][0][0] << endl;
    return 0;
}
