import Data.List
import Data.Tuple
import Data.Bool

main = do
    ss <- getLine
    [x,y] <- map read . words <$> getLine :: IO [Int]
    let (xs,ys) = accum ss [0] [0]
        xs' = foldl' expand [0] . filter (/=0) $ xs
        ys' = foldl' expand [0] . filter (/=0) $ ys
    putStrLn . bool "No" "Yes" $ any (==x) xs' && any (==y) ys'

accum [] as bs = (as,bs)
accum ('T':ss) as bs = swap $ accum ss (0:bs) as
accum ('F':ss) (a:as') bs = accum ss ((a+1):as') bs

expand [] _ = []
expand (n:ns) x = (n-x):(n+x):expand ns x
