
-- F
local sub = string.sub
local insert = table.insert
s = io.read("*l")
x, y = io.read("*n", "*n", "*l")

local t1 = {}
local ok1 = false
local function dfs1(i, val)
	if ok1 then
		return true
	end
	if i == 0 then
		if val == 0 then
			ok1 = true
			return true
		end
		return false
	end
	return dfs1(i-1, val-t1[i]) or dfs1(i-1, val+t1[i])
end
local t2 = {}
local ok2 = false
local function dfs2(i, val)
	if ok2 then
		return true
	end
	if i == 0 then
		if val == 0 then
			ok2 = true
			return true
		end
		return false
	end
	return dfs2(i-1, val-t2[i]) or dfs2(i-1, val+t2[i])
end

local function solve()
	local n = 0
	local dirchange = false
	local dir = true -- x zhou
	-- first
	local st = 1
	while sub(s, st, st) == "F" do
		st = st + 1
	end
	x = x - (st - 1)
	for i = st, #s do
		local c = sub(s, i, i)
		if c == "F" then
			n = n + 1
		else
			if n ~= 0 then
				if dir then
					insert(t1, n)
				else
					insert(t2, n)
				end
				n = 0
				dirchange = false
			end
			dirchange = true
			dir = not dir
		end
	end
	if n ~= 0 then
		if dir then
			insert(t1, n)
		else
			insert(t2, n)
		end
	end
	if  dfs1(#t1, x) and dfs2(#t2, y) then
		return "Yes"
	else
		return "No"
	end
end
print(solve())