public static void main ( String args [ ] ) {
  input ( ) ;
  HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ;
  String [ ] s = new String [ N - K + 1 ] ;
  int [ ] arr = new int [ 26 ] ;
  for ( int i = 0 ;
  i <= N - K ;
  i ++ ) {
    if ( i == 0 ) {
      for ( int j = 0 ;
      j < N ;
      j ++ ) arr [ S . charAt ( j ) - 'a' ] ++ ;
    }
    else {
      arr [ S . charAt ( i - 1 ) - 'a' ] -- ;
      arr [ S . charAt ( i + K - 1 ) - 'a' ] ++ ;
    }
    s [ i ] = Arrays . toString ( arr ) ;
    if ( map . containsKey ( s [ i ] ) ) map . put ( s [ i ] , Math . max ( map . get ( s [ i ] ) , i ) ) ;
    else map . put ( s [ i ] , i ) ;
  }
  for ( int i = 0 ;
  i <= N - K ;
  i ++ ) {
    if ( map . get ( s [ i ] ) - i >= K ) {
      System . out . println ( "YES" ) ;
      return ;
    }
  }
  System . out . println ( "NO" ) ;
}

public static void main ( String args [ ] ) { input ( ) ; HashMap < String , Integer > map = new HashMap < String , Integer > ( ) ; String [ ] s = new String [ N - K + 1 ] ; int [ ] arr = new int [ 26 ] ; for ( int i = 0 ; i <= N - K ; i ++ ) { if ( i == 0 ) { for ( int j = 0 ; j < N ; j ++ ) arr [ S . charAt ( j ) - ' a ' ] ++ ; } else { arr [ S . charAt ( i - 1 ) - ' a ' ] -- ; arr [ S . charAt ( i + K - 1 ) - ' a ' ] ++ ; } s [ i ] = Arrays . toString ( arr ) ; if ( map . containsKey ( s [ i ] ) ) map . put ( s [ i ] , Math . max ( map . get ( s [ i ] ) , i ) ) ; else map . put ( s [ i ] , i ) ; } for ( int i = 0 ; i <= N - K ; i ++ ) { if ( map . get ( s [ i ] ) - i >= K ) { System . out . println ( " YES " ) ; return ; } } System . out . println ( " NO " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (expression_statement (method_invocation name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))))))) alternative: (block (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (character_literal))))) (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) right: (character_literal))))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) (identifier)))))) alternative: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))