public static void main ( String [ ] args ) throws Exception {
  BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  StringTokenizer tokenizer = new StringTokenizer ( input . readLine ( ) ) ;
  int n = Integer . parseInt ( tokenizer . nextToken ( ) ) ;
  int m = Integer . parseInt ( tokenizer . nextToken ( ) ) ;
  char [ ] [ ] nBoard = new char [ n ] [ ] ;
  char [ ] [ ] mBoard = new char [ m ] [ ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    nBoard [ i ] = input . readLine ( ) . toCharArray ( ) ;
  }
  for ( int i = 0 ;
  i < m ;
  i ++ ) {
    mBoard [ i ] = input . readLine ( ) . toCharArray ( ) ;
  }
  boolean state = false ;
  TH : for ( int i = 0 ;
  i < ( n - m ) + 1 ;
  i ++ ) {
    for ( int j = 0 ;
    j < ( n - m ) + 1 ;
    j ++ ) {
      boolean state2 = true ;
      MT : for ( int k = 0 ;
      k < m ;
      k ++ ) {
        for ( int l = 0 ;
        l < m ;
        l ++ ) {
          if ( nBoard [ i + k ] [ j + l ] != mBoard [ k ] [ l ] ) {
            state2 = false ;
            break MT ;
          }
        }
      }
      if ( state2 ) {
        state = true ;
        break TH ;
      }
    }
  }
  System . out . println ( state ? "Yes" : "No" ) ;
}

public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer tokenizer = new StringTokenizer ( input . readLine ( ) ) ; int n = Integer . parseInt ( tokenizer . nextToken ( ) ) ; int m = Integer . parseInt ( tokenizer . nextToken ( ) ) ; char [ ] [ ] nBoard = new char [ n ] [ ] ; char [ ] [ ] mBoard = new char [ m ] [ ] ; for ( int i = 0 ; i < n ; i ++ ) { nBoard [ i ] = input . readLine ( ) . toCharArray ( ) ; } for ( int i = 0 ; i < m ; i ++ ) { mBoard [ i ] = input . readLine ( ) . toCharArray ( ) ; } boolean state = false ; TH : for ( int i = 0 ; i < ( n - m ) + 1 ; i ++ ) { for ( int j = 0 ; j < ( n - m ) + 1 ; j ++ ) { boolean state2 = true ; MT : for ( int k = 0 ; k < m ; k ++ ) { for ( int l = 0 ; l < m ; l ++ ) { if ( nBoard [ i + k ] [ j + l ] != mBoard [ k ] [ l ] ) { state2 = false ; break MT ; } } } if ( state2 ) { state = true ; break TH ; } } } System . out . println ( state ? " Yes " : " No " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (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 (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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (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 (identifier)) dimensions: (dimensions)))) (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 (identifier)) dimensions: (dimensions)))) (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: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))) (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: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (labeled_statement (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: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (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: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (labeled_statement (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: (identifier)) update: (update_expression (identifier)) body: (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: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) index: (binary_expression left: (identifier) right: (identifier))) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement (identifier))))))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true))) (break_statement (identifier))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (ternary_expression condition: (identifier) consequence: (string_literal) alternative: (string_literal)))))))