local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
string.totable = function(s) local t={} local u=string.sub for i=1,#s do t[i] = u(s, i, i) end return t end
string.split = function(s) local t={} for w in string.gmatch(s, "[^%s]+") do table.insert(t, w) end return (table.unpack or unpack)(t) end
----
-- returns n! % m
local function modfactorial(n, m)
    local a = 1
    for i=1, n do
        a = a * i % m
    end
    return a
end
----
local MOD = math.floor(10^9) + 7
local N = read.nl()
local S = read.l():totable()

local lcount = 0
local ans = 1

for i=1,2*N do
    local ev = i % 2 == 0 and 1 or 0
    local c = S[i] == 'W' and 0 or 1
    --[[                
        ev  c   example     flip    L           R           use
        0   0   i=3,W       Do not  flip        not flip    R
        0   1   i=3,B       Do      flip        not flip    L
        1   0   i=2,W       Do not  not flip    flip        L
        1   1   i=2,B       Do      not flip    flip        R
    ]]
    if ev ~ c == 0 then
        -- R
        if lcount <= 0 then
            print(0)
            return
        end
        ans = ans * lcount % MOD
        lcount = lcount - 1
    else
        -- L
        lcount = lcount + 1
    end
end
if lcount > 0 then
    print(0)
    return
end

ans = ans * modfactorial(N, MOD) % MOD
print(ans)