DIV = 1_000_000_007
n = gets.to_i
l = n.times.map{ gets.chomp }
l.delete('-')
s = l.size
u = l.count('U')
dp = 2.times.map{ [0]*(s+1) }
dp[0][0] = 1
pos = 0
pre = true
for i in (0...s)
  pos += 1 if pre
  if l[i] == 'U' && !pre
    pre = true
  elsif l[i] == 'D' && pre
    pre = false
  end
  for j in (0..i+1)
    dp[1][j] = (j > 0 ? dp[0][j-1]*(pos-j) : 0)
    dp[1][j] += dp[0][j]*(pre ? pos-j : pos-j-1) if j < i+1
    dp[1][j] %= DIV
  end
  dp.rotate!
end
p dp[0][u]