#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long

using namespace std;

int a, b, x, y, o;

char s[8007];

int main() {
	scanf("%s", s + 1);
	scanf("%d%d", &a, &b);
	for (int i = 1; i <= strlen(s); i++) {
		if (s[i] == 'T') o ^= 1;
		else {
			if (o == 1) y += 1;
			else x += 1;
		}
	}
	if ((x - a) % 2 == 0 && (y - b) % 2 == 0) printf("Yes");
	else printf("No");
	return 0;
}