using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            B();
        }

        static void B()
        {
            var NM = ReadSplitInt();
            var A = new string[NM[0], NM[0]];
            var B = new string[NM[1], NM[1]];
            for (int i = 0; i < NM[0]; i++)
            {
                var input = Read().ToArray();
                for (int j = 0; j < NM[0]; j++)
                {
                    A[i, j] = input[j].ToString();
                }
            }

            for (int i = 0; i < NM[1]; i++)
            {
                var input = Read().ToArray();
                for (int j = 0; j < NM[1]; j++)
                {
                    B[i, j] = input[j].ToString();
                }
            }

            for (int i = 0; i < NM[0]; i++)
            {
                for (int j = 0; j < NM[0]; j++)
                {
                    var ok = true;
                    for (int ma = 0; ma < NM[1]; ma++)
                    {
                        for (int mb = 0; mb < NM[1]; mb++)
                        {
                            if ((i + ma >= NM[0] || j + mb >= NM[0]) || A[i + ma, j + mb] != B[ma, mb])
                            {
                                ok = false;
                                break;
                            }
                        }
                    }
                    if (ok)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                }
            }
            Console.WriteLine("No");
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static IList<string> ReadSplit() => Read().Split().ToList();
        static IList<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();

        static void Print(object value = null) => Console.Write(value.ToString());
        static void Println(object value = null) => Console.WriteLine(value.ToString());
    }
}


Measured memory_bytes: 11348