enum class DIR {
    left, right, up, down
}
fun main(arg: Array<String>) {
    val S = next()
    val (X, Y) = listOfInt()
    val A = mutableListOf<Int>()
    var c = 0
    S.forEach { s ->
        when (s) {
            'F' -> c += 1
            'T' -> { A.add(c); c = 0 }
        }
    }
    if (c > 0) A.add(c)
    val OFFSET = 10000; val OFFSET2 = 2 * OFFSET
    val matrix = Array(2) { BooleanArray(OFFSET2) }
    matrix[0][OFFSET] = true; matrix[1][OFFSET] = true
    A.forEachIndexed { index, dis ->
        val p = mutableListOf<Int>()
        if (index % 2 == 0) { //x
            if (index == 0) p.add(OFFSET + dis)
            else
                for (x in 0 until OFFSET2) {
                    if (matrix[0][x]) {
                        p.add(x + dis)
                        p.add(x - dis)
                        matrix[0][x] = false
                    }
                }
            p.forEach { x -> matrix[0][x] = true }
        } else { //y
            for (y in 0 until OFFSET2) {
                if (matrix[1][y]) {
                    p.add(y + dis)
                    p.add(y - dis)
                    matrix[1][y] = false
                }
            }
            p.forEach { y -> matrix[1][y] = true }
        }
    }
    val ans = if (matrix[0][OFFSET + X] && matrix[1][OFFSET + Y]) "Yes" else "No"
    println(ans)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
