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 = (s+1).times.map{ [0]*(s+1) }
dp[0][0] = 1
pos = 0
cnt = 0
pre = true
for i in (0...s)
  pos += 1 if pre
  if l[i] == 'U'
    pre = true
    cnt += 1
  else
    pre = false
  end
  for j in (0..i+1)
    dp[i+1][j] = dp[i][j-1]*(pos-j) if j > 0 
    dp[i+1][j] += dp[i][j]*(cnt-j) if j < i+1
    dp[i+1][j] %= DIV
  end
end
p dp[s][u]