import queue as q



direction = [[1, 0], [-1, 0], [0, -1], [0, 1]]



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

s = []

for i in range(H):

    s_i = eval(input())

    s.append([s_i[i] for i in range(len(s_i))])





def do_bfs(s, que):

    while True:

        if que.empty():

            break

        pos = que.get()

        for arrow in direction:

            next = [pos[0] + arrow[0], pos[1] + arrow[1]]

            if next[0] == -1 or next[0] == H or next[1] == -1 or next[1] == W:

                continue

            if s[next[0]][next[1]] == "#":

                que.put(next)

                s[next[0]][next[1]] = "."





for i in range(H):

    for j in range(W):

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

            # check not isolated

            is_conneted = False

            for arrow in direction:

                neighbor = [i + arrow[0], j + arrow[1]]

                if (

                    neighbor[0] == -1

                    or neighbor[0] == H

                    or neighbor[1] == -1

                    or neighbor[1] == W

                ):

                    continue

                if s[neighbor[0]][neighbor[1]] == "#":

                    is_conneted = True

                    break

            if is_conneted:

                s[i][j] = "."

                que = q.Queue()

                que.put([i, j])

                do_bfs(s, que)

# check

for i in range(H):

    for j in range(W):

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

            print("No")

            exit()

print("Yes")

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

s = []

for i in range(H):

    s_i = eval(input())

    s.append([s_i[i] for i in range(len(s_i))])

direction = [[1, 0], [-1, 0], [0, -1], [0, 1]]

for i in range(H):

    for j in range(W):

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

            # check isolated

            is_isolated = True

            for arrow in direction:

                neigh = [i + arrow[0], j + arrow[1]]

                if neigh[0] == -1 or neigh[0] == H or neigh[1] == -1 or neigh[1] == W:

                    continue

                if s[neigh[0]][neigh[1]] == "#":

                    is_isolated = False

                    break

            if is_isolated:

                print("No")

                exit()

print("Yes")

import queue as q

direction = [[1, 0], [-1, 0], [0, -1], [0, 1]]
H, W = list(map(int, input().split()))
s = []
for i in range(H):
    s_i = eval(input())
    s.append([s_i[i] for i in range(len(s_i))])


def do_bfs(s, que):
    while True:
        if que.empty():
            break
        pos = que.get()
        for arrow in direction:
            next = [pos[0] + arrow[0], pos[1] + arrow[1]]
            if next[0] == -1 or next[0] == H or next[1] == -1 or next[1] == W:
                continue
            if s[next[0]][next[1]] == "#":
                que.put(next)
                s[next[0]][next[1]] = "."


for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            # check not isolated
            is_conneted = False
            for arrow in direction:
                neighbor = [i + arrow[0], j + arrow[1]]
                if (
                    neighbor[0] == -1
                    or neighbor[0] == H
                    or neighbor[1] == -1
                    or neighbor[1] == W
                ):
                    continue
                if s[neighbor[0]][neighbor[1]] == "#":
                    is_conneted = True
                    break
            if is_conneted:
                s[i][j] = "."
                que = q.Queue()
                que.put([i, j])
                do_bfs(s, que)
# check
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            print("No")
            exit()
print("Yes")

H, W = list(map(int, input().split()))
s = []
for i in range(H):
    s_i = eval(input())
    s.append([s_i[i] for i in range(len(s_i))])
direction = [[1, 0], [-1, 0], [0, -1], [0, 1]]
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            # check isolated
            is_isolated = True
            for arrow in direction:
                neigh = [i + arrow[0], j + arrow[1]]
                if neigh[0] == -1 or neigh[0] == H or neigh[1] == -1 or neigh[1] == W:
                    continue
                if s[neigh[0]][neigh[1]] == "#":
                    is_isolated = False
                    break
            if is_isolated:
                print("No")
                exit()
print("Yes")

-import queue as q - -direction = [[1, 0], [-1, 0], [0, -1], [0, 1]] - - -def do_bfs(s, que): -    while True: -        if que.empty(): -            break -        pos = que.get() -        for arrow in direction: -            next = [pos[0] + arrow[0], pos[1] + arrow[1]] -            if next[0] == -1 or next[0] == H or next[1] == -1 or next[1] == W: -                continue -            if s[next[0]][next[1]] == "#": -                que.put(next) -                s[next[0]][next[1]] = "." - - +direction = [[1, 0], [-1, 0], [0, -1], [0, 1]] -            # check not isolated -            is_conneted = False +            # check isolated +            is_isolated = True -                neighbor = [i + arrow[0], j + arrow[1]] -                if ( -                    neighbor[0] == -1 -                    or neighbor[0] == H -                    or neighbor[1] == -1 -                    or neighbor[1] == W -                ): +                neigh = [i + arrow[0], j + arrow[1]] +                if neigh[0] == -1 or neigh[0] == H or neigh[1] == -1 or neigh[1] == W: -                if s[neighbor[0]][neighbor[1]] == "#": -                    is_conneted = True +                if s[neigh[0]][neigh[1]] == "#": +                    is_isolated = False -            if is_conneted: -                s[i][j] = "." -                que = q.Queue() -                que.put([i, j]) -                do_bfs(s, que) -# check -for i in range(H): -    for j in range(W): -        if s[i][j] == "#": -            print("No") -            exit() +            if is_isolated: +                print("No") +                exit()