output_description: If the objective is achievable, print `Yes`; if it is not, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      s
      x y
attempt: # 盤面座標は8000x8000(x 2)
  N = 8000
  s = input()
  target_x, target_y = map(int, input().split())
  
  # "FTTFF" -> [1, 0, 2]と変換。'F1TF0TF2T'のFだけとる
  dat_f = [len(Fcount) for Fcount in s.split("T")]
  
  # マイナスを含むxとyのDP用配列(=x2)を作る +1するのは原点用
  # x, yの閾値判定するのが面倒なので倍(=x2)用意する(index error対策)
  curmap_x = [False] * ((N * 2 * 2) + 1)
  curmap_y = [False] * ((N * 2 * 2) + 1)
  nextmap_x = [False] * ((N * 2 * 2) + 1)
  nextmap_y = [False] * ((N * 2 * 2) + 1)
  
  # 初期座標 0,0なのだが、最初Fから始まる場合は(x,0)から始まるし、y軸を向きながら処理する
  if s[0] == "F":
      start = 1
      curmap_x[N * 2 + dat_f[0]] = True
      direction_x = False
  else:
      start = 0
      curmap_x[N * 2] = True
      direction_x = True
  
  # y=0
  curmap_y[N * 2] = True
  
  # 処理すべき最初のFから
  for i in range(start, len(dat_f)):
      step = dat_f[i]
      if direction_x:
          for j in range(N, N + (N * 2) + 1):
              nextmap_x[j] = True if curmap_x[j - step] or curmap_x[j + step] else False
          curmap_x, nextmap_x = nextmap_x, curmap_x
      else:
          for j in range(N, N + (N * 2) + 1):
              nextmap_y[j] = True if curmap_y[j - step] or curmap_y[j + step] else False
          curmap_y, nextmap_y = nextmap_y, curmap_y
  
      # くる
      direction_x = not direction_x
  
  print("Yes" if curmap_x[N * 2 + target_x] and curmap_y[N * 2 + target_y] else "No")
  
problem_description: Statement
  
  A robot is put at the origin in a two-dimensional plane. Initially, the robot
  is facing in the positive x-axis direction.
  
  This robot will be given an instruction sequence s. s consists of the
  following two kinds of letters, and will be executed in order from front to
  back.
  
    * `F` : Move in the current direction by distance 1.
    * `T` : Turn 90 degrees, either clockwise or counterclockwise.
  
  The objective of the robot is to be at coordinates (x, y) after all the
  instructions are executed. Determine whether this objective is achievable.
samples: [{"input": "FTFFTFFF\n    4 2", "output": "Yes\n    \n\nThe objective can be achieved by, for example, turning counterclockwise in the\nfirst `T` and turning clockwise in the second `T`.\n\n* * *"}, {"input": "FTFFTFFF\n    -2 -2", "output": "Yes\n    \n\nThe objective can be achieved by, for example, turning clockwise in the first\n`T` and turning clockwise in the second `T`.\n\n* * *"}, {"input": "FF\n    1 0", "output": "No\n    \n\n* * *"}, {"input": "TF\n    1 0", "output": "No\n    \n\n* * *"}, {"input": "FFTTFF\n    0 0", "output": "Yes\n    \n\nThe objective can be achieved by, for example, turning counterclockwise in the\nfirst `T` and turning counterclockwise in the second `T`.\n\n* * *"}, {"input": "TTTT\n    1 0", "output": "No"}]