#include <bits/stdc++.h>

using namespace std;

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef long double ld;

const int inf = 1e9;
const ll inf64 = 1e18;

const int mod = 998244353;

inline int _mul(int a, int b) {
    return (1ll * a * b) % mod;
}

inline int _sum(int a, int b) {
    return a + b < mod ? a + b : a + b - mod;
}

inline int _sub(int a, int b) {
    return a >= b ? a - b : a - b + mod;
}

inline void _inc(int &x, int y) {
    if ((x += y) >= mod) {
        x -= mod;
    }
}

inline void _dec(int &x, int y) {
    if ((x -= y) < 0) {
        x += mod;
    }
}

inline int _binpow(int x, int p) {
    int res = 1;
    int tmp = x;
    while (p > 0) {
        if (p & 1) {
            res = _mul(res, tmp);
        }
        tmp = _mul(tmp, tmp);
        p >>= 1;
    }
    return res;
}

const int N = 3e6 + 5;

int fact[N];
int rfact[N];

void precalc() {
    fact[0] = 1;
    for (int i = 1; i < N; i++) {
        fact[i] = _mul(fact[i - 1], i);
    }
    rfact[N - 1] = _binpow(fact[N - 1], mod - 2);
    for (int i = N - 2; i >= 0; i--) {
        rfact[i] = _mul(rfact[i + 1], i + 1);
    }
}

inline int CNK(int n, int k) {
    if (n < k) {
        return 0;
    }
    return _mul(fact[n], _mul(rfact[n - k], rfact[k]));
}

inline int F(int n, int k) {
    return CNK(n + k - 1, k);
}

int main() {

    precalc();

#ifdef debug
    freopen("input.txt", "r", stdin);
#endif

    int n, m;

    cin >> n >> m;

    int res = 0;

    for (int i = m & 1; i <= m; i += 2) {
        _inc(
            res,
            _mul(
                CNK(n, i),
                F(n, (3 * m - i) / 2)
            )
        );
    }

    _dec(
        res,
        _mul(
            n,
            F(n, m - 1)
        )
    );

    cout << res << "\n";

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  int cnt = 0;
  ll ans = 1;
  rep(i, 2*N) {
    if(S[i] == 'B') {
      if(cnt%2) {
        if(cnt == 0) {
          ans = 0;
          break;
        }
        (ans *= cnt) %= mod;
        cnt--;
      } else {
        ans *= 1;
        cnt++;
      }
    } else {
      if(cnt%2) {
        ans *= 1;
        cnt++;
      } else {
        if(cnt == 0) {
          ans = 0;
          break;
        }
        (ans *= cnt) %= mod;
        cnt--;
      }
    }
  }
  function<ll(ll)> fact = [&](ll n) {
    if(n == 0) return 1LL;
    else return (n * fact(n-1)) % mod;
  };
  if(cnt) cout << 0 << endl;
  else cout << (ans * fact(N)) % mod << endl;
  return 0;
}
