local str = io.read("*l")
local finalA,finalB = io.read("*n","*n")
io.read()


local tb = {}
for i = 1, string.len(str) do
    table.insert(tb,string.sub(str,i,i))
end

local dirTb = {
    {0,1},
    {0,-1},
    {-1,0},
    {1,0}
}

local turnTb = {
    {3,4},
    {3,4},
    {1,2},
    {1,2}
}
local function digui( a,b,idx,curDir )
    if a == finalA and b == finalB and idx == #tb + 1 then
        return true
    end

    if idx > #tb then
        return false
    end

    if math.abs(a) > #tb or math.abs(b) > #tb then
        return false
    end

    if tb[idx] == 'F' then
        return digui(a+dirTb[curDir][1],b+dirTb[curDir][2],idx+1,curDir)
    else
        return digui(a,b,idx+1,turnTb[curDir][1]) or digui(a,b,idx+1,turnTb[curDir][2]) 
    end

end

local f = digui(0,0,1,1) or digui(0,0,1,2) or digui(0,0,1,3) or digui(0,0,1,4)
print(f and "yes" or "no")