public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int cells = sc . nextInt ( ) ;
  int jumps = sc . nextInt ( ) ;
  sc . nextLine ( ) ;
  String path = sc . nextLine ( ) ;
  int g = path . indexOf ( "G" ) ;
  int t = path . indexOf ( "T" ) ;
  if ( t < g ) {
    StringBuilder sb = new StringBuilder ( path ) ;
    sb . reverse ( ) ;
    path = sb . toString ( ) ;
    g = path . indexOf ( "G" ) ;
    t = path . indexOf ( "T" ) ;
  }
  int pos = g + jumps ;
  boolean found = false ;
  while ( pos < cells && ! found && pos <= t ) {
    if ( path . charAt ( pos ) == '#' ) {
      System . out . println ( "NO" ) ;
      found = true ;
    }
    else if ( path . charAt ( pos ) == 'T' ) {
      System . out . println ( "YES" ) ;
      found = true ;
    }
    pos += jumps ;
  }
  if ( ! found ) {
    System . out . println ( "NO" ) ;
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cells = sc . nextInt ( ) ; int jumps = sc . nextInt ( ) ; sc . nextLine ( ) ; String path = sc . nextLine ( ) ; int g = path . indexOf ( " G " ) ; int t = path . indexOf ( " T " ) ; if ( t < g ) { StringBuilder sb = new StringBuilder ( path ) ; sb . reverse ( ) ; path = sb . toString ( ) ; g = path . indexOf ( " G " ) ; t = path . indexOf ( " T " ) ; } int pos = g + jumps ; boolean found = false ; while ( pos < cells && ! found && pos <= t ) { if ( path . charAt ( pos ) == ' # ' ) { System . out . println ( " NO " ) ; found = true ; } else if ( path . charAt ( pos ) == ' T ' ) { System . out . println ( " YES " ) ; found = true ; } pos += jumps ; } if ( ! found ) { 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)))))) (local_variable_declaration type: (integral_type) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (unary_expression operand: (identifier))) right: (binary_expression left: (identifier) right: (identifier)))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (assignment_expression left: (identifier) right: (true)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (assignment_expression left: (identifier) right: (true)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))