#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#define ll long long
using namespace std;
char s1[8005];
ll x,y;
ll xk=0,yk=0;
ll xx[5]={0,0,0,1,-1},yy[5]={0,1,-1,0,0};
ll t=3;
int main()
{
	scanf("%s",s1);
	scanf("%lld%lld",&x,&y);
	for(ll i=0;i<strlen(s1);i++)
	{
		if(s1[i]=='F')
		{
			xk+=xx[t],yk+=yy[t];
		}
		else{
			if(t==3||t==4)
			{
				if(yk<=y) t=1;
				else t=2;
			}
			else{
				if(xk<=x) t=3;
				else t=4;
			}
		}
	}
	if(xk==x&&yk==y)
	printf("Yes");
	else printf("No");
	return 0;
}