import Data.List
import Data.Array
import Data.Array.ST
import Control.Monad
import Control.Monad.ST

main = do
    s <- getLine
    (x:y:_) <- map read.words<$>getLine::IO[Int]
    let (es,os) = (\(es,os)-> (map snd es, 0:map snd os)) $ partition (even.fst) $ zip [0..] $ unfoldr ps (0,s)
    let xdp = dp es
    let ydp = dp os
    putStrLn $ if (xdp ! (length es - 1, x)) && (ydp ! (length os - 1, y)) then "Yes" else "No"

ps (0,[]) = Nothing
ps (i,[]) = Just(i, (0,[]))
ps (i, 'F':ss) = ps (i+1,ss)
ps (i, 'T':ss) = Just (i, (0, ss))

dp (n:ns) = runSTArray $ do
    ar <- newArray ((0,(-8000)),(8000,8000)) False::ST s (STArray s (Int,Int) Bool)
    writeArray ar (0,n) True
    forM_ [(iv,j)|iv<-zip [1..] ns,j<-[(-8000)..8000]] $ \((i,v),j) -> do
        when (j-v < (-8000)) $ writeArray ar (i,j) =<< readArray ar (i-1,j+v)
        when (j+v >  8000) $ writeArray ar (i,j) =<< readArray ar (i-1,j-v)
        when (j-v >= (-8000) && j+v <= 8000) $ writeArray ar (i,j) =<<  (||) <$> readArray ar (i-1,j+v) <*> readArray ar (i-1,j-v)
    return ar