#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
const ld eps=1e-8;
int main() {
    int n; cin >> n;
	ll dp[201][201] = {};
	dp[0][0] = 1;
	vector<char> v;
	rep(i, n) {
		char t;cin >> t;
		if (t != '-')v.push_back(t);
	}
	int len = v.size();
	rep(i, len) {
		rep(j, len+1) {
			if (v[i] == 'U') {
				dp[i + 1][j + 1] += dp[i][j];
				dp[i + 1][j + 1] %= MOD;
				dp[i + 1][j] += dp[i][j] * j;
				dp[i + 1][j] %= MOD;
			}
			else {
				dp[i + 1][j] += dp[i][j] * j;
				dp[i + 1][j] %= MOD;
				if (j - 1 >= 0) {
					dp[i + 1][j - 1] += dp[i][j] * j*j;
					dp[i + 1][j - 1] %= MOD;
				}
			}
		}
	}
	cout << dp[len][0] << endl;
	return 0;
}
