import std.algorithm;
import std.array;
import std.ascii;
import std.bigint;
import std.complex;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

void readlnTo(T...)(ref T t) {
    auto s = readln().split();
    assert(s.length == t.length);
    foreach(ref ti; t) {
        ti = s[0].to!(typeof(ti));
        s = s[1..$];
    }
}

class UnionFindTree {
public:
    this(size_t n) {
        parent = iota(n).array();
        rank = new size_t[](n);
    }
    size_t find(size_t n) {
        if(n == parent[n]) {
            return n;
        } else {
            parent[n] = find(parent[n]);
            return parent[n];
        }
    }
    void unite(size_t n, size_t m) {
        auto p1 = find(n);
        auto p2 = find(m);
        if(n == m) {
            return;
        }
        if(rank[p1] < rank[p2]) {
            swap(p1, p2);
        }
        if(rank[p1] == rank[p2]) {
            ++rank[p1];
        }
        parent[p2] = p1;
    }
private:
    size_t[] parent;
    size_t[] rank;
}
unittest {
    auto uft = new UnionFindTree(10);
    foreach(i; iota(10)) {
        assert(uft.find(i) == i);
    }
    foreach(i; iota(10).filter!(a => a%3 == 0).drop(1)) {
        uft.unite(i, i-3);
    }
    foreach(i; iota(10).filter!(a => a%3 == 0)) {
        assert(uft.find(0) == uft.find(i));
    }
    foreach(i; iota(10).filter!(a => a%3 != 0)) {
        assert(uft.find(0) != uft.find(i));
    }
}

const real eps = 1e-10;

const long p = 1_000_000_000 + 7;

bool test(long[] l, long x) {
    auto m = l.sum(0L);
    if(abs(m) < abs(x)) {
        return false;
    }
    auto dp = new bool[](2*m+1);
    dp[m] = true;
    foreach(li; l) {
        auto nDP = new bool[](2*m+1);
        foreach(i; iota(dp.length.to!long)) {
            if(0L <= i+li && i+li < dp.length) {
                nDP[i+li] |= dp[i];
            }
            if(0L <= i-li && i-li < dp.length) {
                nDP[i-li] |= dp[i];
            }
        }
        dp = nDP;
    }
    return dp[m+x];
}

void main(){
    auto s = readln().chomp();
    long x, y;
    readlnTo(x, y);
    long[] X, Y;

    enum Muki {Yoko, Tate}
    Muki muki = Muki.Yoko;
    size_t idx;
    while(idx < s.length && s[idx] == 'F') {
        --x;
        ++idx;
    }
    long c;
    while(idx < s.length) {
        if(s[idx] == 'T') {
            if(muki == Muki.Yoko) {
                if(c > 0) {
                    X ~= c;
                    c = 0;
                }
                muki = Muki.Tate;
            } else {
                if(c > 0) {
                    Y ~= c;
                    c = 0;
                }
                muki = Muki.Yoko;
            }
        } else {
            ++c;
        }
        ++idx;
    }
    if(c > 0) {
        if(muki == Muki.Yoko) {
            X ~= c;
        } else {
            Y ~= c;
        }
    }

    writeln(test(X, x) && test(Y, y) ? "Yes": "No");
}



Measured memory_bytes: 4476