#include <bits/stdc++.h>
#define X first
#define Y second
#define mp make_pair
using namespace std;
typedef long long ll;
const int N = 100010;
const int M = 20000;
int sx,sy;
char s[N];
int a[N],tot;
bitset<M> B;
int main(){
	scanf("%s",s);
	scanf("%d%d",&sx,&sy);
	int len = strlen(s);
	int cnt =0;
	for(int i =0;i<len;i++){
		if(s[i]=='F') cnt++;
		else {
			a[++tot] = cnt;
			cnt = 0;
		}
	}
	a[++tot] = cnt;
	//for(int i = 1;i<=tot;i++) cout<<a[i]<<' ';cout<<endl;
	bool pd  = true;
	B.set(M/2);
	for(int i = 1;i<=tot;i+=2){
		if(i!=1)
		B = (B>>a[i])|(B<<a[i]);
		else B = B<<a[i];
	}
	if(B[M/2+sx]==0) pd =false;
	B.reset();
	B.set(M/2);
	for(int i =2;i<=tot;i+=2){
		B = (B>>a[i])|(B<<a[i]);
	}
	if(B[M/2+sy]==0) pd =false;
	if(pd){
		puts("Yes");
	} else puts("No");
	return 0;
}