N = int(eval(input()))

S = eval(input())

MOD = 10**9+7



if S[0]=="W" or S[-1]=="W":

    print((0))

else:

    l = [0]*(2*N)

    for i in range(1, 2*N):

        if S[i]==S[i-1]:

            l[i] = 1 if l[i-1]==0 else 0

        else:

            l[i] = 0 if l[i-1]==0 else 1

    pair = sum(l)



    fac = [None]*(N+1)

    fac[1] = 1

    for i in range(2, N+1):

        fac[i] = fac[i-1] * i

        fac[i] %= MOD



    ans = 0

    if pair==N:

        buf = 0

        ans = 1

        for i in l[::-1]:

            if i:

                buf += 1

            else:

                ans *= buf

                ans %= MOD

                buf -= 1

        

        ans *= fac[N]

        ans %= MOD

    print(ans)

N = int(eval(input()))

S = eval(input())

MOD = 10**9+7



if S[0]=="W" or S[-1]=="W":

    print((0))

else:

    l = [0]*(2*N)

    for i in range(1, 2*N):

        if S[i]==S[i-1]:

            l[i] = 0 if l[i-1] else 1

        else:

            l[i] = 1 if l[i-1] else 0

    pair = sum(l)



    facN = 1

    for i in range(2, N+1):

        facN *= i

        facN %= MOD



    ans = 0

    if pair==N:

        buf = 0

        ans = facN

        for i in l[::-1]:

            if i:

                buf += 1

            else:

                ans *= buf

                ans %= MOD

                buf -= 1

    print(ans)

N = int(eval(input()))
S = eval(input())
MOD = 10**9 + 7
if S[0] == "W" or S[-1] == "W":
    print((0))
else:
    l = [0] * (2 * N)
    for i in range(1, 2 * N):
        if S[i] == S[i - 1]:
            l[i] = 1 if l[i - 1] == 0 else 0
        else:
            l[i] = 0 if l[i - 1] == 0 else 1
    pair = sum(l)
    fac = [None] * (N + 1)
    fac[1] = 1
    for i in range(2, N + 1):
        fac[i] = fac[i - 1] * i
        fac[i] %= MOD
    ans = 0
    if pair == N:
        buf = 0
        ans = 1
        for i in l[::-1]:
            if i:
                buf += 1
            else:
                ans *= buf
                ans %= MOD
                buf -= 1
        ans *= fac[N]
        ans %= MOD
    print(ans)

N = int(eval(input()))
S = eval(input())
MOD = 10**9 + 7
if S[0] == "W" or S[-1] == "W":
    print((0))
else:
    l = [0] * (2 * N)
    for i in range(1, 2 * N):
        if S[i] == S[i - 1]:
            l[i] = 0 if l[i - 1] else 1
        else:
            l[i] = 1 if l[i - 1] else 0
    pair = sum(l)
    facN = 1
    for i in range(2, N + 1):
        facN *= i
        facN %= MOD
    ans = 0
    if pair == N:
        buf = 0
        ans = facN
        for i in l[::-1]:
            if i:
                buf += 1
            else:
                ans *= buf
                ans %= MOD
                buf -= 1
    print(ans)

-            l[i] = 1 if l[i - 1] == 0 else 0 +            l[i] = 0 if l[i - 1] else 1 -            l[i] = 0 if l[i - 1] == 0 else 1 +            l[i] = 1 if l[i - 1] else 0 -    fac = [None] * (N + 1) -    fac[1] = 1 +    facN = 1 -        fac[i] = fac[i - 1] * i -        fac[i] %= MOD +        facN *= i +        facN %= MOD -        ans = 1 +        ans = facN -        ans *= fac[N] -        ans %= MOD