mod = 10 ** 9 + 7



n = int(eval(input()))

s = eval(input())

t = list([1 if x == 'B' else 0 for x in s])

t = tuple((tt - df) % 2 for tt, df in zip(t, reversed(list(range(n * 2)))))

# print(t)



ans = 1

zeros = 0

ones = 0

for tt in t:

    if tt == 0:

        zeros += 1

    else:

        if zeros == 0:

            print((0))

            exit()

        ans *= zeros

        ans %= mod

        zeros -= 1

        ones += 1



if zeros > 0:

    print((0))

    exit()



for i in range(1, n + 1):

    ans *= i

    ans %= mod



print(ans)

mod = 10 ** 9 + 7



n = int(eval(input()))

s = eval(input())

t = [(ind % 2) ^ (ss == 'W') for ind, ss in enumerate(s)]

# print(t)



ans = 1

zeros = 0

for tt in t:

    if tt == 0:

        zeros += 1

    else:

        if zeros == 0:

            print((0))

            exit()

        ans = ans * zeros % mod

        zeros -= 1



if zeros > 0:

    print((0))

    exit()



for i in range(1, n + 1):

    ans = ans * i % mod



print(ans)

mod = 10**9 + 7
n = int(eval(input()))
s = eval(input())
t = list([1 if x == "B" else 0 for x in s])
t = tuple((tt - df) % 2 for tt, df in zip(t, reversed(list(range(n * 2)))))
# print(t)
ans = 1
zeros = 0
ones = 0
for tt in t:
    if tt == 0:
        zeros += 1
    else:
        if zeros == 0:
            print((0))
            exit()
        ans *= zeros
        ans %= mod
        zeros -= 1
        ones += 1
if zeros > 0:
    print((0))
    exit()
for i in range(1, n + 1):
    ans *= i
    ans %= mod
print(ans)

mod = 10**9 + 7
n = int(eval(input()))
s = eval(input())
t = [(ind % 2) ^ (ss == "W") for ind, ss in enumerate(s)]
# print(t)
ans = 1
zeros = 0
for tt in t:
    if tt == 0:
        zeros += 1
    else:
        if zeros == 0:
            print((0))
            exit()
        ans = ans * zeros % mod
        zeros -= 1
if zeros > 0:
    print((0))
    exit()
for i in range(1, n + 1):
    ans = ans * i % mod
print(ans)

-t = list([1 if x == "B" else 0 for x in s]) -t = tuple((tt - df) % 2 for tt, df in zip(t, reversed(list(range(n * 2))))) +t = [(ind % 2) ^ (ss == "W") for ind, ss in enumerate(s)] -ones = 0 -        ans *= zeros -        ans %= mod +        ans = ans * zeros % mod -        ones += 1 -    ans *= i -    ans %= mod +    ans = ans * i % mod