#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "vector"
#include "string"
#include "map"
#include "unordered_map"
#include "algorithm"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	vector<vector<long long int>>dp(N + 1, vector<long long int>(N + 1));
	dp[0][0] = 1;
	for (int i = 1; i <= N; i++) {
		char c;
		cin >> c;
		if (c == '-') {
			for (int j = 0; j <= N; j++)dp[i][j] = dp[i - 1][j];
		}
		else if (c == 'D') {
			for (int j = 1; j <= N; j++) {
				dp[i][j - 1] += dp[i - 1][j] * j*j;
				dp[i][j - 1] %= MOD;
			}
			for (int j = 0; j <= N; j++) {
				dp[i][j] += dp[i - 1][j] * j;
				dp[i][j] %= MOD;
			}
		}
		else {
			for (int j = 0; j <= N; j++) {
				dp[i][j] += dp[i - 1][j] * j;
				dp[i][j] %= MOD;
			}
			for (int j = 0; j < N; j++) {
				dp[i][j + 1] += dp[i - 1][j];
				dp[i][j] %= MOD;
			}
		}
	}
	cout << dp[N][0] << endl;
	return 0;
}
