
-- F
local sub = string.sub
local insert = table.insert
s = io.read("*l")
x, y = io.read("*n", "*n", "*l")
local t1 = {}
local t2 = {}
local function isok(s, val)
	local has = {[0] = 0}
	local newHas = {}
	for i = 1, #s do
		local data = s[i]
		for _, hasV in pairs(has) do
			local ans = hasV + data
			if not newHas[ans] then
				newHas[ans] = ans
			end
			local ans = hasV - data
			if not newHas[ans] then
				newHas[ans] = ans
			end
		end
		has = newHas
		newHas = {}
	end
	if has[val] then
		return true
	end
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 isok(t1, x) and isok(t2, y) then
		return "Yes"
	else
		return "No"
	end
end
print(solve())
