import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto s = readln.chomp;
  auto cp = [0, 0];
  auto gp = readln.chomp.split.to!(int[]).array;
  auto ds = [[1, 0], [0, 1], [-1, 0], [0, -1]];
  int d = 0;
 
  foreach (e; s) {
    //writeln(cp, d);
    if (e == 'F') {
      cp[0] += ds[d][0];
      cp[1] += ds[d][1];
    } else {
      if (d % 2) {
        auto dx = gp[0] - cp[0];
        if (dx > 0) {
          d = 0;
        } else {
          d = 2;
        }
      } else {
        auto dy = gp[1] - cp[1];
        if (dy > 0) {
          d = 1;
        } else {
          d = 3;
        }
      }
    }
  }
  if (cp == gp) writeln("Yes");
  else writeln("No");
}
