open Batteries
module Myset = Set.Make(Int)

let () =
  let s = Scanf.scanf "%s " (fun a -> a) in
  let x,y = Scanf.scanf "%d %d " (fun a b -> a,b) in

  let c_lst = String.to_list s in

  let rec re_x cnt = function
      [] -> x-cnt, []
    | 'F'::tl -> re_x (cnt+1) tl
    | 'T'::tl -> (x-cnt), tl
  in

  let x,c_lst = re_x 0 c_lst in

  let rec aux xl yl cnt is_x = function
      [] -> if is_x then (cnt::xl),yl else xl,(cnt::yl)
    | 'F'::tl -> aux xl yl (cnt+1) is_x tl
    | 'T'::tl -> 
      if cnt = 0 then
        if is_x = true then aux xl yl 0 (not is_x) tl else
          aux xl yl 0 (not is_x) tl
      else
      if is_x = true then aux (cnt::xl) yl 0 (not is_x) tl else
        aux xl (cnt::yl) 0 (not is_x) tl
  in
  let xl,yl = aux [] [] 0 false c_lst in

  let xset = (Myset.add 0 Myset.empty) in
  let x_ans = List.fold_left (fun set1 dy -> 
      Myset.fold (fun el set2 -> 
          let retset = Myset.add (el-dy) (Myset.add (el+dy) set2) in retset
        ) set1 (Myset.empty)
    ) xset xl in

  let yset = (Myset.add 0 Myset.empty) in
  let y_ans = List.fold_left (fun set1 dy -> 
      Myset.fold (fun el set2 -> 
          let retset = Myset.add (el-dy) (Myset.add (el+dy) set2) in retset
        ) set1 (Myset.empty)
    ) yset yl in

  Printf.printf "%s\n" @@
  if (Myset.mem x x_ans) && (Myset.mem y y_ans) then "Yes" else "No"
