
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val s = sc.next()
    val x = sc.nextInt()
    val y = sc.nextInt()

    var xc = mutableSetOf(0)
    var yc = mutableSetOf(0)

    var dirX = true
    var canLeft = false

    var fcount = 0
    s.forEachIndexed { i, c ->
        if (c == 'T') {
            canLeft = canLeft || !dirX
            dirX = !dirX
            return@forEachIndexed
        }

        fcount += 1
        if (s.length > i + 1 && s[i + 1] == 'F') {
            return@forEachIndexed
        }

        if (dirX) {
            val nxc = hashSetOf<Int>()
            xc.forEach {
                nxc += it + fcount
                if (canLeft) nxc += it - fcount
            }
            xc = nxc
        } else {
            val nyc = hashSetOf<Int>()
            yc.forEach {
                nyc += it + fcount
                nyc += it - fcount
            }
            yc = nyc
        }
        fcount = 0
    }

    println(if (x in xc && y in yc) "Yes" else "No")
}