using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    private const int INF = 1000000007;
    private const long INFINITY = 9223372036854775807;
    private struct Pair<T> { public T x, y; public Pair(T xx, T yy) { x = xx; y = yy; } }
    private static int[] dx = { 1, 0, -1, 0 };
    private static int[] dy = { 0, -1, 0, 1 };
    public static void Main()
    {
        string s = NextString();
        //string s = "";
        //for (int i = 0; i < 8000; i++) s += "F";
        int x = NextInt();
        int y = NextInt();
        bool[] xdp = new bool[16010];
        bool[] ydp = new bool[16010];
        xdp[8000] = ydp[8000] = true;

        int f = 0;
        int L = 0;
        for (f = 0; f < s.Length && s[f] == 'F'; f++) L++;
        xdp[8000] = false;
        xdp[8000 + L] = true;

        List<int> xlist = new List<int>();
        List<int> ylist = new List<int>();
        bool varti = true;
        L = 0;
        for (int i = f; i < s.Length; i++)
        {
            if (s[i] == 'F') { L++; }
            else
            {
                if (varti) { xlist.Add(L); varti = false; }
                else { ylist.Add(L); varti = true; }
                L = 0;
            }
        }
        if (s[s.Length - 1] == 'F')
        {
            if (varti) { xlist.Add(L); }
            else { ylist.Add(L); }
        }
        foreach (int d in xlist)
        {
            bool[] nxdp = new bool[16010];
            for (int i = 16000; i >= 0; i--)
                if (xdp[i] && i + d <= 16000) { nxdp[i + d] = true; }
            for (int i = 0; i <= 16000; i++)
                if (xdp[i] && i - d >= 0) nxdp[i - d] = true;
            xdp = nxdp;
        }
        foreach (int d in ylist)
        {
            bool[] nxdp = new bool[16010];
            for (int i = 16000; i >= 0; i--)
                if (ydp[i] && i + d <= 16000) nxdp[i + d] = true;
            for (int i = 0; i <= 16000; i++)
                if (ydp[i] && i - d >= 0) nxdp[i - d] = true;
            ydp = nxdp;
        }

        //for (int i = 0; i <= 16000; i++)
        //    if (xdp[i]) Console.WriteLine(i - 8000);
        Console.WriteLine((xdp[x + 8000] && ydp[y + 8000] ? "Yes" : "No"));
    }
}

public class Input
{
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static char NextChar() { Confirm(); return char.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


Measured memory_bytes: 30032