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

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



def countSharp(x,y):

    res = 0

    if x!=0:

        res += s[x-1][y]=='#'

    if y!=0:

        res += s[x][y-1]=='#'

    if x!=h-1:

        res += s[x+1][y]=='#'

    if y!=w-1:

        res += s[x][y+1]=='#'

    return res



flag = [[False for _ in range(w)] for oijqd in range(h)]

for i,l in enumerate(s):

    for j,c in enumerate(l):

        if c=='.':

            flag[i][j] = True



for i in range(h):

    for j in range(w):

        if s[i][j]=='#' and countSharp(i,j)>0:

            flag[i][j] = True

            if i!=0:

                flag[i-1][j] = True

            if j!=0:

                flag[i][j-1] = True

            if i!=h-1:

                flag[i+1][j] = True

            if j!=w-1:

                flag[i][j+1] = True



res = True

for l in flag:

    if False in l:

        res = False

        break



print(('Yes' if res else 'No'))

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

A=[]



for i in range(H):

    S='.'+eval(input())+'.'

    A.append(S)

K='.'

A.insert(0,K*(W+2))

A.append(K*(W+2))

for i in range(1,H):

    for j in range(1,W):

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

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

                print('No')

                exit(0)



print('Yes')

h, w = list(map(int, input().split()))
s = [eval(input()) for _ in range(h)]


def countSharp(x, y):
    res = 0
    if x != 0:
        res += s[x - 1][y] == "#"
    if y != 0:
        res += s[x][y - 1] == "#"
    if x != h - 1:
        res += s[x + 1][y] == "#"
    if y != w - 1:
        res += s[x][y + 1] == "#"
    return res


flag = [[False for _ in range(w)] for oijqd in range(h)]
for i, l in enumerate(s):
    for j, c in enumerate(l):
        if c == ".":
            flag[i][j] = True
for i in range(h):
    for j in range(w):
        if s[i][j] == "#" and countSharp(i, j) > 0:
            flag[i][j] = True
            if i != 0:
                flag[i - 1][j] = True
            if j != 0:
                flag[i][j - 1] = True
            if i != h - 1:
                flag[i + 1][j] = True
            if j != w - 1:
                flag[i][j + 1] = True
res = True
for l in flag:
    if False in l:
        res = False
        break
print(("Yes" if res else "No"))

H, W = list(map(int, input().split()))
A = []
for i in range(H):
    S = "." + eval(input()) + "."
    A.append(S)
K = "."
A.insert(0, K * (W + 2))
A.append(K * (W + 2))
for i in range(1, H):
    for j in range(1, W):
        if A[i][j] == "#":
            if (
                A[i + 1][j] == "."
                and A[i - 1][j] == "."
                and A[i][j + 1] == "."
                and A[i][j - 1] == "."
            ):
                print("No")
                exit(0)
print("Yes")

-h, w = list(map(int, input().split())) -s = [eval(input()) for _ in range(h)] - - -def countSharp(x, y): -    res = 0 -    if x != 0: -        res += s[x - 1][y] == "#" -    if y != 0: -        res += s[x][y - 1] == "#" -    if x != h - 1: -        res += s[x + 1][y] == "#" -    if y != w - 1: -        res += s[x][y + 1] == "#" -    return res - - -flag = [[False for _ in range(w)] for oijqd in range(h)] -for i, l in enumerate(s): -    for j, c in enumerate(l): -        if c == ".": -            flag[i][j] = True -for i in range(h): -    for j in range(w): -        if s[i][j] == "#" and countSharp(i, j) > 0: -            flag[i][j] = True -            if i != 0: -                flag[i - 1][j] = True -            if j != 0: -                flag[i][j - 1] = True -            if i != h - 1: -                flag[i + 1][j] = True -            if j != w - 1: -                flag[i][j + 1] = True -res = True -for l in flag: -    if False in l: -        res = False -        break -print(("Yes" if res else "No")) +H, W = list(map(int, input().split())) +A = [] +for i in range(H): +    S = "." + eval(input()) + "." +    A.append(S) +K = "." +A.insert(0, K * (W + 2)) +A.append(K * (W + 2)) +for i in range(1, H): +    for j in range(1, W): +        if A[i][j] == "#": +            if ( +                A[i + 1][j] == "." +                and A[i - 1][j] == "." +                and A[i][j + 1] == "." +                and A[i][j - 1] == "." +            ): +                print("No") +                exit(0) +print("Yes")