public static void main ( String [ ] srgs ) {
  Scanner scan = new Scanner ( System . in ) ;
  int a = scan . nextInt ( ) ;
  int b = scan . nextInt ( ) ;
  String strA [ ] = new String [ a ] ;
  String strB [ ] = new String [ b ] ;
  for ( int i = 0 ;
  i != a ;
  i ++ ) {
    strA [ i ] = scan . next ( ) ;
  }
  for ( int i = 0 ;
  i != b ;
  i ++ ) {
    strB [ i ] = scan . next ( ) ;
  }
  int fig = 0 ;
  loop : for ( int i = 0 ;
  i != a - b + 1 ;
  i ++ ) {
    for ( int k = 0 ;
    k != a - b + 1 ;
    k ++ ) {
      if ( strA [ i ] . substring ( k , k + b ) . equals ( strB [ 0 ] ) ) {
        for ( int j = 1 ;
        j != b + 1 ;
        j ++ ) {
          if ( j == b ) {
            fig = 1 ;
            break loop ;
          }
          if ( strA [ i + j ] . substring ( k , k + b ) . equals ( strB [ j ] ) ) {
          }
          else {
            break ;
          }
        }
      }
    }
  }
  System . out . println ( fig == 1 ? "Yes" : "No" ) ;
}

public static void main ( String [ ] srgs ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; String strA [ ] = new String [ a ] ; String strB [ ] = new String [ b ] ; for ( int i = 0 ; i != a ; i ++ ) { strA [ i ] = scan . next ( ) ; } for ( int i = 0 ; i != b ; i ++ ) { strB [ i ] = scan . next ( ) ; } int fig = 0 ; loop : for ( int i = 0 ; i != a - b + 1 ; i ++ ) { for ( int k = 0 ; k != a - b + 1 ; k ++ ) { if ( strA [ i ] . substring ( k , k + b ) . equals ( strB [ 0 ] ) ) { for ( int j = 1 ; j != b + 1 ; j ++ ) { if ( j == b ) { fig = 1 ; break loop ; } if ( strA [ i + j ] . substring ( k , k + b ) . equals ( strB [ j ] ) ) { } else { break ; } } } } } System . out . println ( fig == 1 ? " 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))) 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)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) 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: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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: (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: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (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: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (break_statement (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation object: (method_invocation object: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) consequence: (block) alternative: (block (break_statement)))))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (ternary_expression condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) consequence: (string_literal) alternative: (string_literal)))))))