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

l=[eval(input()) for i in range(h)]



ans='Yes'

for i in range(1,h-1):

    for j in range(1,w-1):

        if l[i][j]=='#':

            if l[i-1][j]==l[i+1][j]==l[i][j-1]==l[i][j+1]=='.':

                ans='No'

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

l=['.'*(w+2)]+['.'+eval(input())+'.' for i in range(h)]+['.'*(w+2)]



ans='Yes'

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

    for j in range(1,w+1):

        if l[i][j]=='#':

            if l[i-1][j]==l[i+1][j]==l[i][j-1]==l[i][j+1]=='.':

                ans='No'

print(ans)
h, w = list(map(int, input().split()))
l = [eval(input()) for i in range(h)]
ans = "Yes"
for i in range(1, h - 1):
    for j in range(1, w - 1):
        if l[i][j] == "#":
            if l[i - 1][j] == l[i + 1][j] == l[i][j - 1] == l[i][j + 1] == ".":
                ans = "No"
print(ans)

h, w = list(map(int, input().split()))
l = ["." * (w + 2)] + ["." + eval(input()) + "." for i in range(h)] + ["." * (w + 2)]
ans = "Yes"
for i in range(1, h + 1):
    for j in range(1, w + 1):
        if l[i][j] == "#":
            if l[i - 1][j] == l[i + 1][j] == l[i][j - 1] == l[i][j + 1] == ".":
                ans = "No"
print(ans)

-l = [eval(input()) for i in range(h)] +l = ["." * (w + 2)] + ["." + eval(input()) + "." for i in range(h)] + ["." * (w + 2)] -for i in range(1, h - 1): -    for j in range(1, w - 1): +for i in range(1, h + 1): +    for j in range(1, w + 1):