#include <iostream>
#include <vector>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) reep((i),0,(n))
long long MOD = 1000000007LL;

long long dp[210][210];


int main() {
	int n;
	cin >> n;
	dp[0][0] = 1;
	vector<char> v(n);
	rep(i, n) {
		cin >> v[i];
		if(v[i] == '-') {
			n--;
			i--;
		}
	}
	// v.erase(v.begin()+n, v.end());

	rep(i, n) {
		char t = v[i];
		rep(j, n) {
			if(t == 'U') {
				if(j>0) (dp[i + 1][j] += j*dp[i][j]%MOD) %= MOD;
				(dp[i + 1][j + 1] += dp[i][j]) %= MOD;
			}
			else {
				if(j - 1 >= 0) (dp[i + 1][j - 1] += j*j*dp[i][j]) %= MOD;
				if(j>0) (dp[i + 1][j] += j*dp[i][j]) %= MOD;
			}
		}
	}
	cout << dp[n][0] << endl;
}