public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  while ( sc . hasNext ( ) ) {
    String s = sc . next ( ) ;
    int x = sc . nextInt ( ) + PLUS ;
    int y = sc . nextInt ( ) + PLUS ;
    List < Integer > ax = new ArrayList < > ( ) ;
    List < Integer > ay = new ArrayList < > ( ) ;
    boolean isOdd = false ;
    for ( int i = 0 ;
    i < s . length ( ) ;
    i ++ ) {
      int cnt = 0 ;
      while ( i < s . length ( ) && s . charAt ( i ) == 'F' ) {
        cnt ++ ;
        i ++ ;
      }
      if ( isOdd ) {
        ay . add ( cnt ) ;
      }
      else {
        ax . add ( cnt ) ;
      }
      isOdd = ! isOdd ;
    }
    int nowX = PLUS + ax . get ( 0 ) ;
    int nowY = PLUS ;
    if ( check ( nowX , x , ax . subList ( 1 , ax . size ( ) ) ) && check ( nowY , y , ay ) ) {
      System . out . println ( "Yes" ) ;
    }
    else {
      System . out . println ( "No" ) ;
    }
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; while ( sc . hasNext ( ) ) { String s = sc . next ( ) ; int x = sc . nextInt ( ) + PLUS ; int y = sc . nextInt ( ) + PLUS ; List < Integer > ax = new ArrayList < > ( ) ; List < Integer > ay = new ArrayList < > ( ) ; boolean isOdd = false ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int cnt = 0 ; while ( i < s . length ( ) && s . charAt ( i ) == ' F ' ) { cnt ++ ; i ++ ; } if ( isOdd ) { ay . add ( cnt ) ; } else { ax . add ( cnt ) ; } isOdd = ! isOdd ; } int nowX = PLUS + ax . get ( 0 ) ; int nowY = PLUS ; if ( check ( nowX , x , ax . subList ( 1 , ax . size ( ) ) ) && check ( nowY , y , ay ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (while_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))))