import Data.List
import Data.Array.IO
import Control.Monad

size = 8000

main = do
  s <- getLine
  (x:y:_) <- map (read :: String -> Int) . words <$> getLine
  memoX <- newArray ((0, (-size)), (size, size)) False :: IO (IOUArray (Int, Int) Bool)
  memoY <- newArray ((0, (-size)), (size, size)) False :: IO (IOUArray (Int, Int) Bool)
  let (xI, yI) = spl s
  writeArray memoX (0, 0) True
  writeArray memoY (0, 0) True
  dpX memoX 1 xI
  dpY memoY 1 yI
  resultX <- readArray memoX (length xI, x)
  resultY <- readArray memoY (length yI, y)
  if resultX && resultY then putStrLn "Yes"
                        else putStrLn "No"

spl :: [Char] -> ([Int], [Int])
spl s = spl' 1 ((length . takeWhile (=='F') $ s):[], []) $ dropWhile (=='F') s

spl' :: Int -> ([Int], [Int]) -> [Char] -> ([Int], [Int])
spl' _ (x, y) []      = (filter (/=0) . reverse $ x, filter (/=0) . reverse $ y)
spl' 0 (x, y) ('T':s) = spl' 1 ((length . takeWhile (=='F') $ s):x, y) $ dropWhile (=='F') s
spl' 1 (x, y) ('T':s) = spl' 0 (x, (length . takeWhile (=='F') $ s):y) $ dropWhile (=='F') s

dpX :: IOUArray (Int, Int) Bool -> Int -> [Int] -> IO (IOUArray (Int, Int) Bool)
dpX memo _ []     = return memo
dpX memo 1 (d:ds) = do
  writeArray memo (1, d) True
  dpX memo 2 ds >>= return
dpX memo n (d:ds) = do
  memo' <- foldM (memoize n d) memo [(-size)..size]
  dpX memo' (n+1) ds >>= return

dpY :: IOUArray (Int, Int) Bool -> Int -> [Int] -> IO (IOUArray (Int, Int) Bool)
dpY memo _ []     = return memo
dpY memo 1 (d:ds) = do
  writeArray memo (1, d) True
  writeArray memo (1, (-d)) True
  dpY memo 2 ds >>= return
dpY memo n (d:ds) = do
  memo' <- foldM (memoize n d) memo [(-size)..size]
  dpY memo' (n+1) ds >>= return

memoize :: Int -> Int -> IOUArray (Int, Int) Bool -> Int -> IO (IOUArray (Int, Int) Bool)
memoize n d memo x
  | x - d >= (-size) && x + d <= size = do
    a <- readArray memo (n-1, x-d)
    b <- readArray memo (n-1, x+d)
    writeArray memo (n, x) $ a || b
    return memo
  | x - d >= (-size) = do
    a <- readArray memo (n-1, x-d)
    writeArray memo (n, x) a
    return memo
  |  x + d <= size = do
    b <- readArray memo (n-1, x+d)
    writeArray memo (n, x) b
    return memo
  | otherwise = do
    return memo
