#!/usr/bin/env python3

h, w, n = map(int, input().split())

stops = []

for _ in range(n):
    stop = []
    for _ in range(h):
        stop.append(input())
    stops.append(stop)

screen = []
for _ in range(h):
    screen.append(input())

def compare(stop, screen):
    for hh in range(h):
        for ww in range(w):
            if ['.', 'x'] == [stop[hh][ww], screen[hh][ww]]:
                return False
    return True

count = 0
for stop in stops:
    if compare(stop, screen):
        count += 1

if count == 1:
    print("yes")
else:
    print("no")
