#include <bits/stdc++.h>
using namespace std;

constexpr int mod = 1e9 + 7;
int64_t dp[220][220];
int main() {
  int n;
  cin >> n;

  vector<bool> ud;
  for (int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    if (c == '-') continue;
    ud.push_back(c == 'U');
  }

  dp[0][0] = 1;
  n = ud.size();
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (ud[i]) {
        (dp[i + 1][j + 1] += dp[i][j]) %= mod;
        (dp[i + 1][j] += j * dp[i][j]) %= mod;
      } else {
        if (j) (dp[i + 1][j - 1] += j * j * dp[i][j]) %= mod;
        (dp[i + 1][j] += j * dp[i][j]) %= mod;
      }
    }
  }

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

