#!/usr/bin/env python3
h, w, n = map(int, input().split())

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

possible = [1 for _ in range(n)]
here = [input()[:w] for _ in range(h)]

for i in range(n):
    for y in range(h):
        for x in range(w):
            if here[y][x] == 'x' and not stops[i][y][x] == 'x':
                possible[i] = 0

print("yes" if sum(possible) == 1 else "no")
