A robot is put at the origin in a two-dimensional plane. Initially, the robot is facing in the positive x-axis direction.

This robot will be given an instruction sequence s. s consists of the following two kinds of letters, and will be executed in order from front to back.

* `F` : Move in the current direction by distance 1.
* `T` : Turn 90 degrees, either clockwise or counterclockwise.



The objective of the robot is to be at coordinates (x, y) after all the instructions are executed. Determine whether this objective is achievable.

Constraints

* s consists of `F` and `T`.
* 1 \leq |s| \leq 8 000
* x and y are integers.
* |x|, |y| \leq |s|

Input

Input is given from Standard Input in the following format:


s
x y


Output

If the objective is achievable, print `Yes`; if it is not, print `No`.

Examples

Input

FTFFTFFF
4 2


Output

Yes


Input

FTFFTFFF
-2 -2


Output

Yes


Input

FF
1 0


Output

No


Input

TF
1 0


Output

No


Input

FFTTFF
0 0


Output

Yes


Input

TTTT
1 0


Output

No
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,collections,itertools,re,math,fractions,decimal,random,array,bisect,heapq

# decimal.getcontext().prec = 50
# sys.setrecursionlimit(10000)
# MOD = 10**9 + 7

def solve(f):
    s = f.read_str()
    x, y = f.read_int_list()

    l = s.split('T')
    x0 = len(l[0])

    ys = {0}
    for i in l[1::2]:
        ys2 = set()
        yi = len(i)
        for item in ys:
            ys2.add(item+yi)
            ys2.add(item-yi)
        ys = ys2

    if y not in ys: return 'No'

    xs = {x0}
    for i in l[2::2]:
        xs2 = set()
        xi = len(i)
        for item in xs:
            xs2.add(item+xi)
            xs2.add(item-xi)
        xs = xs2

    if x not in xs: return 'No'

    return 'Yes'


class Reader(object):
    def __init__(self, filename=None):
        self.file = open(filename) if filename is not None else None
        self.case = 1

    def __readline(self):
        return self.file.next().strip() if self.file else raw_input()

    def next_case(self):
        self.file.next()
        self.case += 1

    def read_int(self): return int(self.__readline())
    def read_float(self): return float(self.__readline())
    def read_long(self): return long(self.__readline())
    def read_decimal(self): return decimal.Decimal(self.__readline())
    def read_str(self): return self.__readline()

    def read_int_list(self): return map(int, self.__readline().split())
    def read_float_list(self): return map(float, self.__readline().split())
    def read_long_list(self): return map(long, self.__readline().split())
    def read_decimal_list(self): return map(decimal.Decimal, self.__readline().split())
    def read_str_list(self): return self.__readline().split()

if __name__ == '__main__':
    filename = sys.argv[1] if len(sys.argv) > 1 else None
    f = Reader(filename)
    if f.file:
        while True:
            print "Case #%d\n"%f.case, solve(f)
            try:
                f.next_case()
            except StopIteration:
                break
    else:
        print solve(f)
