#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
using namespace std;
typedef pair<ll,ll> pll;


ll n;
string s;
ll a[200005];
ll b[200005];
const ll mod = 1e9 + 7;
ll ans;
ll suf[200005];
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(NULL); cout.tie(NULL);
        cin >> n; n+=n;
        cin >> s;
        if(s[0] == 'W' || s[n-1] == 'W'){
                cout << "0\n"; return 0;
        }
        a[0]=1;
        ll cnt = 1;
        ll tc=1;
        b[0]=1;
        ll L = 1;
        ll R = 0;
        for(ll i=1;i<n;i++) {
                if(s[i] == s[i-1]){
                        b[i] =1-b[i-1];
                }else b[i] = b[i-1];
                if(b[i]) L++;
                else R++;
        }
        if(L != R){
                cout << "0\n"; return 0;
        }
        ans=1LL;
        for(ll i=n-1;i>=0;i--) {
                suf[i] = suf[i+1] + b[i];
        }
        ll l=0;
        ll r=0;
        for(ll i=0;i<n;i++) {
                if(b[i] == 0){
                        ans = (ans * (l-r))%mod;
                        r++;
                }else l++;
        }
        for(ll i=1;i<=(n/2);i++) ans = (ans * i)%mod;
        cout << ans << endl;
        return 0;
}

//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

//////////////////////////


int main(){fastio
    
    ll n;cin>>n;
    string s;cin>>s;
    ll ans=1;
    rep(i,1,n)ans=mod(ans*i);
    ll cnt=0;
    rep(i,0,2*n-1){
        if((s[i]=='B')^(cnt%2==0)){
            ans=mod(ans*cnt);
            cnt--;
            if(cnt<0){
                cout<<0<<endl;return 0;
            }
        }else{
            cnt++;
        }
        //cout<<cnt<<" ";
    }
    if(cnt!=0)ans=0;
    cout<<mod(ans)<<endl;
    
    return 0;
}
