fun main(args: Array<String>) {
    val s = readLine()!!
    var (x, y) = readLine()!!.split(" ").map{it.toInt()}

    if (Math.max(Math.abs(x), Math.abs(y)) > s.length) {
        println(":(")
        return
    }

    val ss = s.split("T").map{ it.length }
    x -= ss[0]
    val l = ss.drop(1)

    fun canCreate(a: Int, l: List<Int>): Boolean {
        val t = Math.abs(a)
        var curr = BooleanArray(t * 2 + 1) { false }
        var next = BooleanArray(t * 2 + 1) { false }
        curr[t] = true

        for (b in l) {
            for (i in curr.indices) {
                if (i + b < next.size) {
                    next[i + b] = curr[i] || next[i + b]
                }
                if (i - b >= 0) {
                    next[i - b] = curr[i] || next[i - b]
                }
            }

            val tmp = next
            next = curr
            curr = tmp
            next.fill(false)
        }

        return curr[t + a]
    }

    fun judge(a: Int, b: Int): Boolean {
        return canCreate(a, l.filterIndexed { index, c -> index % 2 == 0}) &&
                canCreate(b, l.filterIndexed { index, c -> index % 2 == 1})
    }

    if (judge(y, x)) {
        println("Yes")
    } else {
        println("No")
    }
}
