unittest
{
	assert( [ "FTFFTFFF", "4 2" ].parse.expand.solve == "Yes" );
	assert( [ "FTFFTFFF", "-2 -2" ].parse.expand.solve == "Yes" );
	assert( [ "FF", "1 0" ].parse.expand.solve == "No" );
	assert( [ "TF", "1 0" ].parse.expand.solve == "No" );
	assert( [ "FFTTFF", "0 0" ].parse.expand.solve == "Yes" );
	assert( [ "TTTT", "1 0" ].parse.expand.solve == "No" );
}



import std.algorithm;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.to!( dchar[] );
	input.popFront;
	auto xy = input.front.split.to!( long[] );
	return tuple( s, xy[ 0 ], xy[ 1 ] );
}

auto solve( dchar[] s, long x, long y )
{
	const OA = 10000L;
	const OB = 100000L;
	const DL = 1;
	const DR = 2;
	const DD = 4;
	const DU = 8;
	
	x += OA;
	y += OA;
	
	auto r = s.count( 'F' );
	byte[ long ] xys_a;
	byte[ long ] xys_b;
	xys_a[ OA + OA * OB ] = DL;
	foreach( g; s.group )
	{
		if( g[ 0 ] == 'F' ) r -= g[ 1 ];
		foreach( k, d; xys_a )
		{
			auto fx = k % OB;
			auto fy = k / OB;
			if( g[ 0 ] == 'F' )
			{
				if( d & DL )
				{
					auto tx = fx + g[ 1 ];
					auto ty = fy;
					if( abs( x - tx ) + abs( y - ty ) <= r ) xys_b[ tx + ty * OB ] |= DL;
				}
				if( d & DR )
				{
					auto tx = fx - g[ 1 ];
					auto ty = fy;
					if( abs( x - tx ) + abs( y - ty ) <= r ) xys_b[ tx + ty * OB ] |= DR;
				}
				if( d & DD )
				{
					auto tx = fx;
					auto ty = fy + g[ 1 ];
					if( abs( x - tx ) + abs( y - ty ) <= r ) xys_b[ tx + ty * OB ] |= DD;
				}
				if( d & DU )
				{
					auto tx = fx;
					auto ty = fy - g[ 1 ];
					if( abs( x - tx ) + abs( y - ty ) <= r ) xys_b[ tx + ty * OB ] |= DU;
				}
			}
			else
			{
				if( d & ( DL | DR ) ) xys_b[ k ] |= ( g[ 1 ] % 2 ) ? ( DD | DU ) : ( DL | DR );
				if( d & ( DD | DU ) ) xys_b[ k ] |= ( g[ 1 ] % 2 ) ? ( DL | DR ) : ( DD | DU );
			}
		}
		xys_a.clear;
		swap( xys_a, xys_b );
	}
	return ( x + y * OB in xys_a ) ? "Yes" : "No";
}
