N=gets.to_i
S=gets.strip.codepoints
W="W".codepoints[0]
B="B".codepoints[0]
ls=S.map.with_index{|e,i| i%2==0 ? (e==W ? B : W) : e}
lcnt=0
ans=1
ls.each do |e|
    if e==W
        lcnt+=1
    else
        ans*=lcnt
        lcnt-=1
    end
end
ans=ans * (1..N).to_a.inject(:*)
puts ans % (10**9+7)
