import scala.io.{StdIn => in}
import scala.collection.{mutable => mu}

object Main extends App {
  val s = in.readLine
  val Array(x, y) = in.readLine.split(" ").map(_.toInt)
  val buf = mu.ArrayBuffer.empty[Int]

  var cnt = 0
  buf += 0
  s.foreach(ch => if(ch == 'F') buf(cnt) += 1 else {cnt += 1; buf += 0})

  // println(buf.mkString(" "))

  def dfsEnum(n:Int):Boolean = {
    // d進 n個列挙
    val enum = Array.ofDim[Int](n)
    // var ret = 0
    var isFind = false
  
    def evalute():Unit = {
      if(enum(0) < 0) return
      var gx = 0
      var gy = 0
      for(i <- 0 until n) {
        if(i % 2 == 0) gx += buf(i) * enum(i)
        else gy += buf(i) * enum(i)
      }
      if(gx == x && gy == y) isFind = true
    }
  
    def dfs(cnt:Int):Unit = {
      if(cnt == n) evalute
      else if(!isFind) {
        enum(cnt) = 1
        dfs(cnt+1)
        enum(cnt) = -1
        dfs(cnt+1)
      }
      else return
    }
  
    dfs(0)
    isFind
  }

  val ans = if(dfsEnum(buf.size)) "Yes" else "No"
  println(ans)
}