#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
using ll = long long;
using pll = pair<ll, ll>;
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define VREP(s, ite) for (auto ite = s.begin(); ite != s.end(); ++ite)
#define FI first
#define SE second
//#define endl "\n"
#define ciosup  \
    cin.tie(0); \
    ios::sync_with_stdio(false);
#define eb emplace_back
#define vint vector<int>
#define vll vector<ll>
constexpr ll INF = 1e9 + 7;
constexpr ll MOD = 1e9 + 7;

template<typename T>
void vecin(vector<T>& v, int n = 0){
    if (n == 0)
        n = v.size();
    for (int i = 0; i < n; ++i)
    {
        cin >> v[i];
    }
}
template <typename T>
void vecout(vector<T> &v, int n = 0)
{
    if (n == 0)
        n = v.size();
    for (int i = 0; i < n-1; ++i)
    {
        cout << v[i] << " ";
    }
    cout << v[n - 1] << endl;
}
void print(string s){
    cout << s << endl;
}

ll extgcd(ll a, ll b, ll &x, ll &y)
{ //extended Euclidean algorithm, used for modular multiplicative inverse
    ll d = a;
    if (b != 0)
    {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }
    else
    {
        x = 1;
        y = 0;
    }
    return d; //return gcd(a,b)
}

ll mod_inv(ll a, ll m = MOD)
{ //return inv(a) mod m, ax+my=gcd(a,m)=1, m is prime int, ax-1=mq equiv. ax-mq=1
    ll x, y;
    extgcd(a, m, x, y);
    return (m + x % m) % m; //From (possibly) negative x to positive x
}

vector<ll> fact, invfact;
void calc_fact(int n, ll m = MOD)
{ //Calculate factorial up to n
    fact.resize(n + 1);
    invfact.resize(n + 1);
    fact[0] = invfact[0] = 1;
    REP(i, n)
    {
        fact[i + 1] = fact[i] * (i + 1) % m;
        invfact[i + 1] = invfact[i] * mod_inv(i + 1) % m;
    }
}
ll perm(int n, int k, ll m = MOD)
{
    if (n < 0 || k < 0 || k > n)
        return 0;
    return fact[n] * invfact[n - k] % m;
}
ll comb(int n, int k, ll m = MOD)
{
    if (n < 0 || k < 0 || k > n)
        return 0;
    return (fact[n] * invfact[n - k] % m) * invfact[k] % m;
}

int main()
{
    ciosup;
    int n;
    cin >> n;
    string s;
    cin >> s;
    if (s[0] == 'W' || s[2*n-1] == 'W'){
        cout << 0 << endl;
    }else{
        ll ans = 1, kazu = 0;
        REP(i,2*n){
            if (i == 0)
            {
                ++kazu;
            }
            else{
                if (s[i] == 'W'){
                    if (kazu % 2 == 0){
                        ans = (ans * kazu) % MOD;
                        --kazu;
                    }
                    else
                    {
                        ++kazu;
                    }
                }else
                {
                    if (kazu % 2 != 0)
                    {
                        ans = (ans * kazu) % MOD;
                        --kazu;
                    }
                    else
                    {
                        ++kazu;
                    }
                }
            }
        }
        if (kazu != 0){
            cout << 0 << endl;
        }else{
            calc_fact(n + 10);
            ans = (ans * perm(n, n)) % MOD;
            cout << ans << endl;
        }
    }
}

Measured memory_bytes: 2196