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

s = [list(eval(input())) for _ in range(h)]

black = []

for i in range(h):

    for j in range(w):

        if s[i][j] == "#":

            black.append([i,j])

for x,y in black:

    flag = False

    for a,b in [(0,1), (1,0), (0,-1), (-1,0)]:

        if [x+a, y+b] in black: flag = True

    if not flag:

        print("No")

        exit()

print("Yes")
h,w = list(map(int, input().split()))

s = [eval(input()) for _ in range(h)]



for i in range(h):

    for j in range(w):

        if s[i][j] == "#":

            flag = False

            for i_new, j_new in [(i+1, j), (i-1, j), (i,j+1), (i,j-1)]:

                if i_new<0 or i_new>=h or j_new<0 or j_new>=w: continue

                if s[i_new][j_new] == "#":

                    flag = True

                    break

            if not flag:

                print("No")

                exit()

print("Yes")

h, w = list(map(int, input().split()))
s = [list(eval(input())) for _ in range(h)]
black = []
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            black.append([i, j])
for x, y in black:
    flag = False
    for a, b in [(0, 1), (1, 0), (0, -1), (-1, 0)]:
        if [x + a, y + b] in black:
            flag = True
    if not flag:
        print("No")
        exit()
print("Yes")

h, w = list(map(int, input().split()))
s = [eval(input()) for _ in range(h)]
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            flag = False
            for i_new, j_new in [(i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)]:
                if i_new < 0 or i_new >= h or j_new < 0 or j_new >= w:
                    continue
                if s[i_new][j_new] == "#":
                    flag = True
                    break
            if not flag:
                print("No")
                exit()
print("Yes")

-s = [list(eval(input())) for _ in range(h)] -black = [] +s = [eval(input()) for _ in range(h)] -            black.append([i, j]) -for x, y in black: -    flag = False -    for a, b in [(0, 1), (1, 0), (0, -1), (-1, 0)]: -        if [x + a, y + b] in black: -            flag = True -    if not flag: -        print("No") -        exit() +            flag = False +            for i_new, j_new in [(i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)]: +                if i_new < 0 or i_new >= h or j_new < 0 or j_new >= w: +                    continue +                if s[i_new][j_new] == "#": +                    flag = True +                    break +            if not flag: +                print("No") +                exit()