#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;

const int mod = (int) 1e9 + 7;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr), cout.tie(nullptr);

	int n;
	string s;
	cin >> n >> s;

	if (s[0] == 'W') {
		cout << 0;
		return 0;
	}

	int cnt = 1;
	bool open = true;
	ll ans = 1;

	for (int i = 1; i < 2 * n; ++i) {
		if (s[i] == s[i - 1])
			open = !open;
		// DBG(open)
		if (open)
			cnt++;
		else {
			if (!cnt) {
				cout << 0;
				return 0;
			}
			(ans *= cnt--) %= mod;
		}
		ans %= mod;
	}
	DBG(ans)
	if (cnt) {
		cout << 0;
		return 0;
	}
	for (int i = 1; i <= n; ++i)
		(ans *= i) %= mod;
	cout << ans;
	return 0;
}
