#include <bits/stdc++.h>
#define name "bai3"
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fto(i,a,b) for(int i=a; i<=b; ++i)
#define maxn 100009
#define ll long long
using namespace std;
const int mod=1e9+7;
int n,a[maxn*2],xd[maxn*2];
ll p[maxn];
//ll q[maxn*2];
/*ll mu(int a, int b){
    if(b==0) return 1;
    ll tg=mu(a,b/2);
    tg=(tg*tg)%mod;
    if(b%2)tg=(tg*a)%mod;
    return tg;
}
ll c(int a, int b){
    ///return b!/(a!*(b-a)!)
    if(a==0)return 0;
    if(a>b)return 0;
    return (((p[b]*q[a])%mod)*q[b-a])%mod;
}*/
int main()
{
    cin >> n;
    int s=0;
    p[0]=1;
    fto(i,1,n)p[i]=(p[i-1]*i)%mod;
    /*q[0]=1;
    q[1]=1;
    fto(i,2,n*2) q[i]=mu(p[i],mod-2);*/
    fto(i,1,n*2){
        char c;
        cin >> c;
        if(c=='B')a[i]=1;
        else a[i]=0;
        if(a[i]==s){
            xd[i]=-1;
        }
        else{
            xd[i]=1;
        }
        s^=1;
    }
    int s1=0,s2=0;
    ll res=1;
    fto(i,1,n*2)
    if(xd[i]==1)++s1;
    else{
        if(s1>s2)res=(res*(s1-s2))%mod;
        else res=0;
        if(res==0)break;
        ++s2;
    }
    if(s1!=s2)res=0;
    cout << res*p[n]%mod;
    return 0;
}
/*
BWWB
WWWW


*/

typedef long long ll;
typedef long double ld;
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
    ll n;
    string s;
    std::cin >> n>>s;
    
    ll rc = 0;
    
    string c = "L";
    for (int i = 1; i < n*2; i++) {
        if(s[i]!=s[i-1]){
            if(c[i-1]=='R'){
                c += 'R';
                rc++;
            }else{
                c += 'L';    
            }
        }else{
            if(c[i-1]=='R'){
                c += 'L';
            }else{
                c += 'R';
                rc++;
            }
        }
    }
    if(s[0]=='W'){
        std::cout << 0 << std::endl;
        return 0;
    }

    if(rc!=n){
        std::cout << 0 << std::endl;
        return 0;
    }
    if(c[2*n-1]=='L'){
        std::cout << 0 << std::endl;
        return 0;
    }
    rc = 0;
    ll ans = 1;

    for (int i = 2*n-1; i >=0; i--) {
        if(c[i]=='R'){
            rc++;
        }else{
            if(rc==0){
                std::cout << 0 << std::endl;
                return 0;
            }
            ans *= rc;
            rc--;
            ans %= MOD;
        }
    }

    for (int i = 0; i < n; i++) {
        ans *= i+1;
        ans %= MOD;
    }
    std::cout << ans << std::endl;
}