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



area = []

for i in range(h):

    array = eval(input())

    area.append(array)





def check(i, j):

    x_1 = max(0, j-1)

    x_2 = min(j+1, w-1)

    y_1 = max(0, i-1)

    y_2 = min(i+1, h-1)

    if area[y_1][j] == '#' or area[y_2][j] == '#' or area[i][x_1] == '#' or area[i][x_2] == '#':

        a = 0

    else:

        print('No')

        exit()



for i in range(h):

    for j in range(w):

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

            check(i, j)



print('Yes')

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



area = []



for i in range(h+2):

    if i == 0 or i == h+1:

        array = '.' * (w+2)

    else:

        array = eval(input())

        array = '.' + array + '.'

    area.append(array)



def check(i, j):

    if area[i][j-1] == '#' or area[i][j+1] == '#' or area[i-1][j] == '#' or area[i+1][j] == '#':

        return True

    else:

        return False



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

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

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

            if not check(i, j):

                print('No')

                exit()

print('Yes')
h, w = list(map(int, input().split()))
area = []
for i in range(h):
    array = eval(input())
    area.append(array)


def check(i, j):
    x_1 = max(0, j - 1)
    x_2 = min(j + 1, w - 1)
    y_1 = max(0, i - 1)
    y_2 = min(i + 1, h - 1)
    if (
        area[y_1][j] == "#"
        or area[y_2][j] == "#"
        or area[i][x_1] == "#"
        or area[i][x_2] == "#"
    ):
        a = 0
    else:
        print("No")
        exit()


for i in range(h):
    for j in range(w):
        if area[i][j] == "#":
            check(i, j)
print("Yes")

h, w = list(map(int, input().split()))
area = []
for i in range(h + 2):
    if i == 0 or i == h + 1:
        array = "." * (w + 2)
    else:
        array = eval(input())
        array = "." + array + "."
    area.append(array)


def check(i, j):
    if (
        area[i][j - 1] == "#"
        or area[i][j + 1] == "#"
        or area[i - 1][j] == "#"
        or area[i + 1][j] == "#"
    ):
        return True
    else:
        return False


for i in range(1, h + 1):
    for j in range(1, w + 1):
        if area[i][j] == "#":
            if not check(i, j):
                print("No")
                exit()
print("Yes")

-for i in range(h): -    array = eval(input()) +for i in range(h + 2): +    if i == 0 or i == h + 1: +        array = "." * (w + 2) +    else: +        array = eval(input()) +        array = "." + array + "." -    x_1 = max(0, j - 1) -    x_2 = min(j + 1, w - 1) -    y_1 = max(0, i - 1) -    y_2 = min(i + 1, h - 1) -        area[y_1][j] == "#" -        or area[y_2][j] == "#" -        or area[i][x_1] == "#" -        or area[i][x_2] == "#" +        area[i][j - 1] == "#" +        or area[i][j + 1] == "#" +        or area[i - 1][j] == "#" +        or area[i + 1][j] == "#" -        a = 0 +        return True -        print("No") -        exit() +        return False -for i in range(h): -    for j in range(w): +for i in range(1, h + 1): +    for j in range(1, w + 1): -            check(i, j) +            if not check(i, j): +                print("No") +                exit()