using System;
using System.Collections;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Security;
using System.Text;
using static System.Console;
using static System.Math;
using  static Ex;
class Simple {
    void Solve() {
        //input
        var s = io.String;
        var x = io.Int;
        var y = io.Int;
        
        //cal
        var ans    = "";
        var offset = 10000;
        var size   = offset * 2;        
        var ss     = s.Split('T').Select(str=>str.Length).ToArray();
        var xLis   = ss.Where((v, i) => i % 2 == 0).ToArray();
        var yLis   = ss.Where((v, i) => i % 2 != 0).ToArray();
        Func <bool, string> Yn = (f) => f ? "Yes" : "No";
        if(yLis.Length != 0 /* && xLis.length == 1*/) {
            var xDp = new bool[xLis.Length, size];
            var yDp = new bool[yLis.Length, size];
            xDp[0, 0 + xLis.First() + offset] = true;
            yDp[0, 0 + yLis.First() + offset] = true;
            yDp[0, 0 - yLis.First() + offset] = true;            
            FOR(1, xLis.Length, i => {            
                size.REP(j => {
                    if((j - xLis[i] > 0    && xDp[i - 1, j - xLis[i]]) ||
                       (j + xLis[i] < size && xDp[i - 1, j + xLis[i]]))
                        xDp[i, j] = true;                    
                });                                    
            });
            FOR(1, yLis.Length, i => {
                size.REP(j => {
                    if((j - yLis[i] > 0    && yDp[i - 1, j - yLis[i]]) ||
                       (j + yLis[i] < size && yDp[i - 1, j + yLis[i]]))
                        yDp[i, j] = true;
                });
            });
            ans = Yn(xDp[xLis.Length - 1, x + offset] && 
                     yDp[yLis.Length - 1, y + offset]);
        } else {
            ans = Yn(xLis.First() == x && y == 0);
        }
        
        //ret
        WriteLine(ans);        
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) => new Simple().Stream();
    private void Stream() {
        //var exStdIn = new System.IO.StreamReader("stdin.txt");
        //SetIn(exStdIn);
        Solve();
        io.Flush();
    }
}
class SimpleIO {
    string[] _nextBuffer;
    int _bufferCnt;
    char[] cs = new char[] {' ', '"', ','};
    StreamWriter sw = new StreamWriter(OpenStandardOutput()) {
#if DEBUG
        AutoFlush = true
#else
        AutoFlush = false
#endif
    };
    public SimpleIO() {
        _nextBuffer = new string[0];
        _bufferCnt = 0;
        SetOut(sw);
    }
    string Next() {
        if(_bufferCnt < _nextBuffer.Length)
            return _nextBuffer[_bufferCnt++];
        var st = ReadLine();
        while(st == "")
            st = ReadLine();
        _nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        _bufferCnt = 0;
        return _nextBuffer[_bufferCnt++];
    }
    public string String => Next();
    public char Char => char.Parse(String);
    public int Int => int.Parse(String);
    public long Long => long.Parse(String);
    public double Double => double.Parse(String);
    public void Flush() => Out.Flush();
}
static class Ex {
    public static void REP(this int n, Action <int> act) {
        for(var i = 0; i < n; ++i)
            act(i);
    }
    public static void FOR(int a, int b, Action <int> act) {
        for(var i = a; i < b; ++i)
            act(i);
    }
}


Measured memory_bytes: 163800