#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef int_fast64_t ll;

template<int N, typename T, T M>
struct ModFact {
    T fact[N+1];
    constexpr ModFact() : fact() {
        fact[0] = 1;
        for (int i=0; i<N; ++i)
            fact[i+1] = (fact[i]*(i+1))%M;
    }
};
 
ModFact<100000, ll, MOD> fact;

ll ans;
int N, M, cnt = 0;
constexpr ll th = 1LL<<45;
char S[200000];

int main() {
    scanf("%d%s", &N, S);
    M = N << 1;
    ans = fact.fact[N];
    char *E = S + M, *C = S;
    while(C < E) {
		if((*C++^cnt)&1) {
            ans = ans * cnt % MOD;
            if(--cnt < 0) break;
        } else ++cnt;
	}
    printf("%lld\n", cnt == 0 ? ans : 0);
    return 0;
}

#include<iostream>
#include<vector>
#include<string>
using namespace std;
#define MOD 1000000007
int main(){
  int n; cin >> n;
  string s; cin >> s;
  vector<long long int> l,r;
  int parity = 0;
  for(int i=0;i< 2*n;i++){
    if(parity < 0){cout << 0 << endl; return 0;}
    if(parity==0 && s[i]=='W'){cout << 0 << endl; return 0;}
    if((parity%2==1) == (s[i]=='W')) {parity++; l.push_back(i);}
    else {parity--; r.push_back(i);}
  }
  if(parity != 0 || (r.size() != n) || (l.size()!=n) ){cout << 0 << endl; return 0;}
  long long int ans = 1;
  for(int i=n-1; i>=0; i--){
  	int num = n - (n-1-i) - (lower_bound(r.begin(), r.end(), l[i]) - r.begin());
    ans = (ans * num) % MOD;
  }
  for(int i=1;i<=n;i++){
    ans = (ans * i) % MOD;
  }
  cout << ans << endl;
  return 0;
}