Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(h):
    for j in range(w):
        if s[j][i] == '#':
            if j + 1 < w and s[i][j+1] == '#':
                continue
            if j - 1 >= 0 and s[i][j-1] == '#':
                continue
            if i + 1 < h and s[i+1][j] == '#':
                continue
            if i - 1 >= 0 and s[i-1][j] == '#':
                continue
            print('No')
            exit()

print('Yes')

Fixed submission:
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(w):
    for j in range(h):
        if s[j][i] == '#':
            if j + 1 < h and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < w and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(w):
    for j in range(h):
        if s[j][i] == '#':
            if j + 1 < w and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < h and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')

Fixed submission:
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(w):
    for j in range(h):
        if s[j][i] == '#':
            if j + 1 < h and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < w and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

b = [[False]*w]*h

for i in range(h):
    for j in range(w):
        if s[j][i] == '#':
            if j + 1 < w and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < h and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')

Fixed submission:
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(w):
    for j in range(h):
        if s[j][i] == '#':
            if j + 1 < h and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < w and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')