import Data.List

data Stat = X | Y deriving(Eq)
main :: IO ()
main = do
    s <- getLine
    [x,y] <- fmap read .words <$> getLine :: IO [Int]
    let (firststeps,s') = (length $ takeWhile (=='F') s,dropWhile (=='F') s)
    let x' = abs $ x - firststeps
    let y' = abs y
    let (xsteps,ysteps) = splxy s'
    let res = solve x' (sum xsteps) xsteps && solve y' (sum ysteps) ysteps
    putStrLn $ if res then "Yes" else "No"
    
splxy :: [Char] -> ([Int],[Int])
splxy = splxy' Y ([],[]) 
    
splxy' :: Stat -> ([Int],[Int]) -> [Char] -> ([Int],[Int]) 
splxy' s (x,y) ('T':tl)     | s == X = splxy' Y ((length $ takeWhile (=='F') tl) : x,y) $ dropWhile(=='F') tl
                            | s == Y = splxy' X (x,(length $ takeWhile (=='F') tl) : y) $ dropWhile(=='F') tl
splxy' s (x,y) [] = (sort x,sort y)

solve :: Int -> Int -> [Int] -> Bool
solve target al ls  | target == al = True
                    | target > al = False
                    | target < al = solve target al' (reverse ls') where
    t:ls' = reverse $takeWhile (>=target) $ map (al -) ls
    al' = al - t
