import sys

sys.setrecursionlimit(100000)



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

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

accept = True



def dfs(x, y, count):

    if  x < 0 or W <= x or y < 0 or H <= y:

        return count - 1

    elif s[y][x] != "#":

        return count - 1

    else:

        s[y][x] = "."

        return max(dfs(x-1, y, count+1), dfs(x+1, y, count+1), dfs(x, y-1, count+1), dfs(x, y+1, count+1))



for y in range(H):

    for x in range(W):

        if s[y][x] != "#":

            continue

        elif dfs(x, y, 0) == 0:

            accept = False



if accept:

    print("Yes")

else:

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

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

accept = True



s = [["."]*(W+2)] + s + [["."]*(W+2)]

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

    s[i] = ["."] + s[i] + ["."]



for y in range(1, H+1):

    for x in range(1, W+1):

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

            if s[y-1][x] == "." and s[y+1][x] == "." and s[y][x-1] == "." and s[y][x+1] == ".":

                accept = False



if accept:

    print("Yes")

else:

    print("No")
import sys

sys.setrecursionlimit(100000)
H, W = list(map(int, input().split()))
s = [[c for c in eval(input())] for _ in range(H)]
accept = True


def dfs(x, y, count):
    if x < 0 or W <= x or y < 0 or H <= y:
        return count - 1
    elif s[y][x] != "#":
        return count - 1
    else:
        s[y][x] = "."
        return max(
            dfs(x - 1, y, count + 1),
            dfs(x + 1, y, count + 1),
            dfs(x, y - 1, count + 1),
            dfs(x, y + 1, count + 1),
        )


for y in range(H):
    for x in range(W):
        if s[y][x] != "#":
            continue
        elif dfs(x, y, 0) == 0:
            accept = False
if accept:
    print("Yes")
else:
    print("No")

H, W = list(map(int, input().split()))
s = [[c for c in eval(input())] for _ in range(H)]
accept = True
s = [["."] * (W + 2)] + s + [["."] * (W + 2)]
for i in range(1, H + 1):
    s[i] = ["."] + s[i] + ["."]
for y in range(1, H + 1):
    for x in range(1, W + 1):
        if s[y][x] == "#":
            if (
                s[y - 1][x] == "."
                and s[y + 1][x] == "."
                and s[y][x - 1] == "."
                and s[y][x + 1] == "."
            ):
                accept = False
if accept:
    print("Yes")
else:
    print("No")

-import sys - -sys.setrecursionlimit(100000) - - -def dfs(x, y, count): -    if x < 0 or W <= x or y < 0 or H <= y: -        return count - 1 -    elif s[y][x] != "#": -        return count - 1 -    else: -        s[y][x] = "." -        return max( -            dfs(x - 1, y, count + 1), -            dfs(x + 1, y, count + 1), -            dfs(x, y - 1, count + 1), -            dfs(x, y + 1, count + 1), -        ) - - -for y in range(H): -    for x in range(W): -        if s[y][x] != "#": -            continue -        elif dfs(x, y, 0) == 0: -            accept = False +s = [["."] * (W + 2)] + s + [["."] * (W + 2)] +for i in range(1, H + 1): +    s[i] = ["."] + s[i] + ["."] +for y in range(1, H + 1): +    for x in range(1, W + 1): +        if s[y][x] == "#": +            if ( +                s[y - 1][x] == "." +                and s[y + 1][x] == "." +                and s[y][x - 1] == "." +                and s[y][x + 1] == "." +            ): +                accept = False