program cell_inversion
  implicit none
  integer(8), parameter :: md = 1000000007_8
  integer :: n, i, d(200000) = 0, l = 0, r = 0
  character(200000) :: s
  integer(8) :: ans
  read(*,*) n
  read(*,*) s
  if (s(1:1) == "W" .or. s(2*n:2*n) == "W") then
    write(*,'(i0)') 0
    stop
  end if
  l = 1
  r = 0
  do i = 2, 2*n
    if (s(i:i) == s(i-1:i-1)) then
      d(i) = 1-d(i-1)
    else
      d(i) = d(i-1)
    end if
    if (d(i) == 0) then
      l = l+1
    else
      r = r+1
    end if
  end do
  if (l /= r .or. d(2*n) == 0) then
    write(*,'(i0)') 0
    stop
  end if
  ans = 1_8
  do i = 1, n
    ans = mod(ans*int(i,8),md)
  end do
  l = 0
  r = 0
  do i = 1, 2*n
    if (d(i) == 1) then
      if (l <= r) then
        write(*,'(i0)') 0
        stop
      end if
      ans = mod(ans*int(l-r,8),md)
      r = r+1
    else
      l = l+1
    end if
  end do
  write(*,'(i0)') ans
end program cell_inversion