#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1e9;
const LL LLINF = 1e16;

template<int mod>
struct ModInt {
    int x;

    ModInt() : x(0) {}
    ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) {
        if((x += p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator-=(const ModInt &p) {
        if((x += mod - p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator*=(const ModInt &p) {
        x = (int)(1LL * x * p.x % mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const{
        int a = x, b = mod, u = 1, v = 0, t;
        while(b > 0) {
            t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        return ModInt(u);
    }

    ModInt pow(int e){
        long long a = 1, p = x;
        while(e > 0) {
            if(e%2 == 0) {p = (p*p) % mod; e /= 2;}
            else {a = (a*p) % mod; e--;}
        }
        return ModInt(a);
    }

    friend ostream &operator<<(ostream &os, const ModInt<mod> &p) {
        return os << p.x;
    }
    friend istream &operator>>(istream &is, ModInt<mod> &a) {
        long long x;
        is >> x;
        a = ModInt<mod>(x);
        return (is);
    }
};

const int mod = 1e9 + 7;
using modint = ModInt<mod>;

int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int now = 1;
    vector<int> ans(n*2, 0);
    ans[0] = 1;
    if(s[0] == 'W'){
        cout << 0 << endl;
        return 0;
    }
    rep1(i, s.size()){
        if(s[i] != s[i-1]){
            if(ans[i-1]){
                ans[i] = 1;
                now++;
            }else{
                if(now == 0){
                    cout << 0 << endl;
                    return 0;
                }
                now--;
            }
        }else{
            if(ans[i-1]){
                if(now == 0){
                    cout << 0 << endl;
                    return 0;
                }else{
                    now--;
                }
            }else{
                ans[i] = 1;
                now++;
            }
        }
    }
    if(now != 0){
        cout << 0 << endl;
        return 0;
    }
    // rep(i, n*2){
    //     cout << ans[i];
    // }
    // cout << endl;
    reverse(all(ans));
    int tmp = 0;
    modint A = 1;
    repe(i, ans){
        if(i == 0){
            tmp++;
        }else{
            A *= tmp;
            tmp--;
        }
    }
    rep1(i, n+1) A *= i;
    cout << A << endl;


}

Measured memory_bytes: 1412