S=io.read()
x=io.read()
y=io.read()
local xcount=0
local ycount=0
local swap=0
for i=1,#S do
  if string.sub(S,i,i)=="F" then
    xcount=xcount+1
  end
  if string.sub(S,i,i)=="T" then
    xcount,ycount=ycount,xcount
    swap=swap+1
  end
end
if swap%2==1 then 
  xcount,ycount=ycount,xcount
end
if xcount>=math.abs(x) and (xcount-math.abs(x))%2==0  and ycount>=math.abs(y) and (ycount-math.abs(y))%2==0 then
  print("Yes")
  else
  print("No")
end  