H, W = list(map(int, input().split()))

tmp = '.' * (W + 2)

matrix = [tmp] * (H + 2)

for i in range(1,H+1):

    matrix[i] = '.' + eval(input()) + '.'

for i in range(1,H+1):

    for k in range(1,W+1):

        if matrix[i][k] == '.':

            continue

        elif matrix[i][k-1] == '.' and matrix[i][k+1] == '.' and matrix[i-1][k] == '.' and matrix[i+1][k] == '.':

            print('No')

            exit()

print('Yes')
H, W = list(map(int,input().split()))

grid = ['.'*(W+2)]

for _ in range(H):

    tmp = eval(input())

    tmp = '.' + tmp + '.'

    grid.append(tmp)

grid.append('.'*(W+2))

for i in range(1,H+1):

    for k in range(1,W+1):

        if grid[i][k] == '.':

            continue

        if grid[i][k+1] != '#' and grid[i][k-1] != '#':

            if grid[i+1][k] != '#' and grid[i-1][k] != '#':

                print('No')

                exit()

print('Yes')
H, W = list(map(int, input().split()))
tmp = "." * (W + 2)
matrix = [tmp] * (H + 2)
for i in range(1, H + 1):
    matrix[i] = "." + eval(input()) + "."
for i in range(1, H + 1):
    for k in range(1, W + 1):
        if matrix[i][k] == ".":
            continue
        elif (
            matrix[i][k - 1] == "."
            and matrix[i][k + 1] == "."
            and matrix[i - 1][k] == "."
            and matrix[i + 1][k] == "."
        ):
            print("No")
            exit()
print("Yes")

H, W = list(map(int, input().split()))
grid = ["." * (W + 2)]
for _ in range(H):
    tmp = eval(input())
    tmp = "." + tmp + "."
    grid.append(tmp)
grid.append("." * (W + 2))
for i in range(1, H + 1):
    for k in range(1, W + 1):
        if grid[i][k] == ".":
            continue
        if grid[i][k + 1] != "#" and grid[i][k - 1] != "#":
            if grid[i + 1][k] != "#" and grid[i - 1][k] != "#":
                print("No")
                exit()
print("Yes")

-tmp = "." * (W + 2) -matrix = [tmp] * (H + 2) -for i in range(1, H + 1): -    matrix[i] = "." + eval(input()) + "." +grid = ["." * (W + 2)] +for _ in range(H): +    tmp = eval(input()) +    tmp = "." + tmp + "." +    grid.append(tmp) +grid.append("." * (W + 2)) -        if matrix[i][k] == ".": +        if grid[i][k] == ".": -        elif ( -            matrix[i][k - 1] == "." -            and matrix[i][k + 1] == "." -            and matrix[i - 1][k] == "." -            and matrix[i + 1][k] == "." -        ): -            print("No") -            exit() +        if grid[i][k + 1] != "#" and grid[i][k - 1] != "#": +            if grid[i + 1][k] != "#" and grid[i - 1][k] != "#": +                print("No") +                exit()