use std::cmp;
use std::collections::HashMap;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        s: chars,
        x: i64,
        y: i64
    }

    let mut x = x;
    let y = y;

    let mut x_moves: Vec<usize> = Vec::new();
    let mut y_moves: Vec<usize> = Vec::new();

    let mut count = 0;
    let mut isX = true;

    let mut init_pos = 0;
    for i in 0..s.len() {
        if s[i] == 'T' || i == s.len() - 1 {
            init_pos = i;
            x = x - i as i64;
            break;
        }
    }

    for i in init_pos..s.len() {
        if s[i] == 'T' {
            if isX {
                x_moves.push(count);
                isX = !isX
            } else {
                y_moves.push(count);
                isX = !isX
            }
            count = 0;
        } else {
            count += 1;
        }
    }
    if isX {
        x_moves.push(count);
    } else {
        y_moves.push(count);
    }

    let ok_x = is_arrivable(&x_moves, x);
    let ok_y = is_arrivable(&y_moves, y);

    if ok_x && ok_y {
        println!("Yes");
    } else {
        println!("No");
    }
}

// x,y座標に対して、移動量の配列からposの位置にいることができるか調べる
fn is_arrivable(moves: &Vec<usize>, pos: i64) -> bool {
    let mut dp = vec![vec![false; 16000 + 1]; moves.len() + 1];

    dp[0][8000] = true;

    for i in 1..moves.len() + 1 {
        let index = i - 1;
        for j in 0..16000 {
            let plus_pattern = if j > moves[index] {
                if dp[index][j - moves[index]] {
                    true
                } else {
                    false
                }
            } else {
                false
            };

            let minus_pattern = if j + moves[index] <= 16000 {
                if dp[index][j + moves[index]] {
                    true
                } else {
                    false
                }
            } else {
                false
            };

            if plus_pattern || minus_pattern {
                dp[i][j] = true;
            }
        }
    }

    if pos + 8000 < 0 {
        false
    } else {
        dp[moves.len()][(pos + 8000) as usize]
    }
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 88316