import scala.io.StdIn.readLine

object Main extends App {
  val Array(n, m) = readLine.split(" ").map(_.toInt)
  val a = Picture(List.fill(n)(readLine.toList))
  val b = Picture(List.fill(m)(readLine.toList))
  println(if (a contains b) "Yes" else "No")

  case class Picture(dots: List[List[Char]]) {
    def contains(pic: Picture): Boolean = {
      dots.sliding(m) exists {
        slides => (slides zip pic.dots) forall {
          case (slide, picsRow) => slide.sliding(m) exists (_ == picsRow)
        }
      }
    }
  }
}
