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

F = [[] for i in range(h)]

for i in range(h):

    a = list(eval(input()))

    F[i] = a



flag = True

for i in range(h):

    for j in range(w):

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

            flag2 = False

            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]:

                nx, ny = i + dx, j + dy

                if 0 <= nx < h and 0 <= ny < w and F[nx][ny] == "#":

                    flag2 = True

            if not flag2:

                flag = False

                break



if flag:

    print("Yes")

else:

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

T = [[] for i in range(h)]

for i in range(h):

    a = list(eval(input()))

    T[i] = a



# for i in range(h):

#     print("".join(map(str, T[i])))



flag = True

for i in range(h):

    for j in range(w):

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

            flag2 = False

            for dx, dy in [(0, 1), (1, 0), (-1, 0), (0, -1)]:

                nx, ny = i + dx, j + dy



                if 0 <= nx < h and 0 <= ny < w and T[nx][ny] == "#":

                    flag2 = True



            if not flag2:

                flag = False



if flag:

    print("Yes")

else:

    print("No")



h, w = list(map(int, input().split()))
F = [[] for i in range(h)]
for i in range(h):
    a = list(eval(input()))
    F[i] = a
flag = True
for i in range(h):
    for j in range(w):
        if F[i][j] == "#":
            flag2 = False
            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
                nx, ny = i + dx, j + dy
                if 0 <= nx < h and 0 <= ny < w and F[nx][ny] == "#":
                    flag2 = True
            if not flag2:
                flag = False
                break
if flag:
    print("Yes")
else:
    print("No")

h, w = list(map(int, input().split()))
T = [[] for i in range(h)]
for i in range(h):
    a = list(eval(input()))
    T[i] = a
# for i in range(h):
#     print("".join(map(str, T[i])))
flag = True
for i in range(h):
    for j in range(w):
        if T[i][j] == "#":
            flag2 = False
            for dx, dy in [(0, 1), (1, 0), (-1, 0), (0, -1)]:
                nx, ny = i + dx, j + dy
                if 0 <= nx < h and 0 <= ny < w and T[nx][ny] == "#":
                    flag2 = True
            if not flag2:
                flag = False
if flag:
    print("Yes")
else:
    print("No")

-F = [[] for i in range(h)] +T = [[] for i in range(h)] -    F[i] = a +    T[i] = a +# for i in range(h): +#     print("".join(map(str, T[i]))) -        if F[i][j] == "#": +        if T[i][j] == "#": -            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]: +            for dx, dy in [(0, 1), (1, 0), (-1, 0), (0, -1)]: -                if 0 <= nx < h and 0 <= ny < w and F[nx][ny] == "#": +                if 0 <= nx < h and 0 <= ny < w and T[nx][ny] == "#": -                break