n, m = list(map(int, input().split()))

field = [list(eval(input())) for i in range(n)]

flg = True

dx = [1, 0, -1, 0]

dy = [0, 1, 0, -1]

for i in range(n):

    for j in range(m):

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

            f = 0

            for k in range(4):

            # 移動した後の点を (nx, ny) とする

                nx = i + dx[k]

                ny = j + dy[k]

                if 0 <= nx and nx < n and 0 <= ny and ny < m and field[nx][ny] == "#":

                    f += 1

            if f==False:

                flg = False

                

print(("Yes" if flg else "No"))
h,w = list(map(int, input().split()))

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

dx = [1,0,-1,0]

dy = [0,1,0,-1]

for k in range(h):

    for j in range(w):

        x,y = k,j

        if a[x][y] == "#":

            for i in range(4):

                xi,yi = x+dx[i],y+dy[i]

                if 0 <= xi < h and 0 <= yi < w and a[xi][yi] == "#":

                    break

            else:

                print("No")

                exit()



print("Yes")
n, m = list(map(int, input().split()))
field = [list(eval(input())) for i in range(n)]
flg = True
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
for i in range(n):
    for j in range(m):
        if field[i][j] == "#":
            f = 0
            for k in range(4):
                # 移動した後の点を (nx, ny) とする
                nx = i + dx[k]
                ny = j + dy[k]
                if 0 <= nx and nx < n and 0 <= ny and ny < m and field[nx][ny] == "#":
                    f += 1
            if f == False:
                flg = False
print(("Yes" if flg else "No"))

h, w = list(map(int, input().split()))
a = [list(eval(input())) for _ in range(h)]
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
for k in range(h):
    for j in range(w):
        x, y = k, j
        if a[x][y] == "#":
            for i in range(4):
                xi, yi = x + dx[i], y + dy[i]
                if 0 <= xi < h and 0 <= yi < w and a[xi][yi] == "#":
                    break
            else:
                print("No")
                exit()
print("Yes")

-n, m = list(map(int, input().split())) -field = [list(eval(input())) for i in range(n)] -flg = True +h, w = list(map(int, input().split())) +a = [list(eval(input())) for _ in range(h)] -for i in range(n): -    for j in range(m): -        if field[i][j] == "#": -            f = 0 -            for k in range(4): -                # 移動した後の点を (nx, ny) とする -                nx = i + dx[k] -                ny = j + dy[k] -                if 0 <= nx and nx < n and 0 <= ny and ny < m and field[nx][ny] == "#": -                    f += 1 -            if f == False: -                flg = False -print(("Yes" if flg else "No")) +for k in range(h): +    for j in range(w): +        x, y = k, j +        if a[x][y] == "#": +            for i in range(4): +                xi, yi = x + dx[i], y + dy[i] +                if 0 <= xi < h and 0 <= yi < w and a[xi][yi] == "#": +                    break +            else: +                print("No") +                exit() +print("Yes")