#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-04-26 12:00:59
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int flag = 0;
  for (auto e : vec) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int flag = 0;
  for (auto e : st) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int flag = 0;
  for (auto e : mp) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

bool dpx[17000], dpy[17000];
constexpr int BASE = 8888;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  string s; cin >> s;
  int x, y; cin >> x >> y;

  int n = s.size();

  vector<pair<char, int>> op;

  int beg = 0;
  while (beg < n) {
    int end = beg;
    while (end + 1 < n && s[beg] == s[end + 1]) {
      ++end;
    }
    int len = end - beg + 1;
    op.emplace_back(s[beg], len);
    beg = end + 1;
  }

  debug(op);

  int dir = 0;  // 0 : x, 1 : y;

  dpx[BASE] = dpy[BASE] = true;

  bool first = true;

  for (auto e : op) {
    if (e.first == 'F') {
      if (first) {
        first = false;
        if (dir & 1) {
          dpy[BASE + e.second] = dpy[BASE - e.second] = true;
          dpy[BASE] = false;
        } else if (dir == 0) {
          dpx[BASE] = false;
          dpx[BASE + e.second] = true;
        } else {
          dpx[BASE + e.second] = dpx[BASE - e.second] = true;
          dpx[BASE] = false;
        }
      } else {
        if (dir & 1) { // y
          bool ty[17000] = {};
          for (int i = BASE - 8080; i <= BASE + 8080; ++i) {
            if (dpy[i]) {
              ty[i + e.second] = ty[i - e.second] = true;
            }
          }
          swap(dpy, ty);
        } else { // x
          bool tx[17000] = {};
          for (int i = BASE - 8080; i <= BASE + 8080; ++i) {
            if (dpx[i]) {
              tx[i + e.second] = tx[i - e.second] = true;
            }
          }
          swap(dpx, tx);
        }
      }
    } else {
      dir += e.second;
    }
  }

  cout << ((dpx[BASE + x] && dpy[BASE + y]) ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 384