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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

int N;
string s,t;
ll dp[202][202];

int main(){
  cin>>N;
  rep(i,N){
    char c;
    cin>>c;
    s+=c;
  }
  rep(i,N){
    if(s[i]=='-')continue;
    t+=s[i];
  }
  s=t;
  N=s.size();
  dp[0][0]=1;
  rep(i,N){
    rep(j,N){
      if(s[i]=='U'){
        (dp[i+1][j]+=dp[i][j]*j%mod)%=mod;
        (dp[i+1][j+1]+=dp[i][j])%=mod;
      }else if(s[i]=='D'){
        if(j>0)(dp[i+1][j-1]+=dp[i][j]*j*j%mod)%=mod;
        (dp[i+1][j]+=dp[i][j]*j)%=mod;
      }
    }
  }
  cout<<dp[N][0]<<endl;
  return 0;
}

