fun main(args: Array<String>) {
    val N = nextInt()
    val S = next().map{ it == 'W' }.toMutableList()
    val L = 2 * N
    for (n in 1..L) {
        if ((L-n) % 2 == 1) S[n-1] = !S[n-1]
    }
//System.err.println(S.map{if (it) 'W' else 'B'}.joinToString(separator = ""))
    var l = 0L
    var ans = 1L
    val MOD = 1000000007L
    S.forEach {
        if (it) l++ else {
            ans *= l
            ans %= MOD
            l--
        }
    }
    for (n in 2..N) {
        ans *= n
        ans %= MOD
    }
    println(if (l == 0L) ans else 0)
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
