import scala.collection.mutable
import scala.io.StdIn._

sealed abstract class Direction
case object North extends Direction
case object East extends Direction
case object South extends Direction
case object West extends Direction

object Main extends App {
  val s = readLine()
  val Array(gx, gy) = readLine().split(" ").map(_.toInt)

  if (search(0, 0, East, s)) println("Yes") else println("No")

  def sides(d: Direction): (Direction, Direction) = d match {
    case North | South => (East, West)
    case _ => (North, South)
  }

  def opposite(d: Direction): Direction = d match {
    case North => South
    case East => West
    case South => North
    case West => East
  }

  def search(x: Int, y: Int, d: Direction, s: String): Boolean = {
    if (s.isEmpty) {
      if (gy == y && gx == x) return true
      else return false
    }

    s.head match {
      case 'T' =>
        var count = 1
        while (count < s.length && s(count) == 'T') {
          count += 1
        }
        if (count % 2 == 1) {
          val next = sides(d)
          search(x, y, next._1, s.tail) ||
            search(x, y, next._2, s.tail)
        } else if (count == 2)
          search(x, y, opposite(d), s.substring(count))
        else {
          search(x, y, d, s.substring(count)) ||
            search(x, y, opposite(d), s.substring(count))
        }

      case _ =>
        d match {
          case North => search(x, y + 1, d, s.tail)
          case East => search(x + 1, y, d, s.tail)
          case South => search(x, y - 1, d, s.tail)
          case West => search(x - 1, y, d, s.tail)
        }
    }
  }

}
