let scan_int () = Scanf.scanf " %d" (fun x -> x)
let print_int n = Printf.printf "%d\n" n

let modulo = 1000000007
let modmul a b = a * b mod modulo

let () =
  let n = scan_int() in
  let s = read_line() in
  let rec loop i curr ret =
    if i = 2 * n && curr = 0 then ret
    else if i = 2 * n || curr < 0 then 0 
    else
      if s.[i] = 'B' then
        if curr mod 2 = 1 then loop (i+1) (curr-1) (modmul ret curr)
        else loop (i+1) (curr+1) ret
      else
        if curr mod 2 = 1 then loop (i+1) (curr+1) ret
        else loop (i+1) (curr-1) (modmul ret curr) in
  let rec calc_factorial i n ret =
    if i > n then ret else calc_factorial (i+1) n (modmul ret i) in
  let a = loop 0 0 1 and b = calc_factorial 1 n 1 in
  print_int (modmul a b)

