import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    auto s = readln.chomp;
    auto goal = readln.split.to!(int[]);
    int x = 0, y = 0;
    int dx = 1, dy = 0;
    foreach (c; s) {
        if (c == 'F') {
            x += dx;
            y += dy;
        } else {
            if (dy == 0) {
                dx = 0;
                dy = goal[1] - y > 0 ? 1 : -1;
            } else {
                dx = goal[0] - x > 0 ? 1 : -1;
                dy = 0;
            }
        }
    }
    writeln(x == goal[0] && y == goal[1] ? "Yes" : "No");
}

