Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

L = []

for i in range(a):
    L.append([j for j in input()])

K = []

for i in range(b):
    K.append([j for j in input()])
ind = 0
for i in range(a-b+1):
    for j in range(a-b+1):
        if L[i][j] == K[0][0] and ind == 0:
            for k in range(b):
                if L[i+k][j:j+b] != K[i+k]:
                    break
                if k == b - 1 and ind == 0:
                    print("Yes")
                    ind = 1
                    break
if ind == 0:
    print("No")

Fixed submission:
a, b = map(int, input().split())

A = []
for i in range(a):
    A.append(list(input()))
B = []
for i in range(b):
    B.append(list(input()))
f = 0
for i in range(a - b + 1):
    for j in range(a - b + 1):
        if A[i][j] == B[0][0]:
            ans = 0
            for k in range(b):
                for l in range(b):
                    if A[i+k][j+l] == B[k][l]:
                        continue
                    else:
                        ans = 1
            if ans == 0 and f == 0:
                print("Yes")
                f = 1
                break
if f == 0:
    print("No")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

L = []

for i in range(a):
    L.append([j for j in input()])

K = []

for i in range(b):
    K.append([j for j in input()])
ind = 0
for i in range(a-b+1):
    for j in range(a-b+1):
        if L[i][j] == K[0][0]:
            for k in range(b):
                if L[i+k][j:j+b] == K[i+k]:
                    continue
                else:
                    break
            if k == b - 1 and ind == 0:
                print("Yes")
                ind = 1
                break
if ind == 0:
    print("No")

Fixed submission:
a, b = map(int, input().split())

A = []
for i in range(a):
    A.append(list(input()))
B = []
for i in range(b):
    B.append(list(input()))
f = 0
for i in range(a - b + 1):
    for j in range(a - b + 1):
        if A[i][j] == B[0][0]:
            ans = 0
            for k in range(b):
                for l in range(b):
                    if A[i+k][j+l] == B[k][l]:
                        continue
                    else:
                        ans = 1
            if ans == 0 and f == 0:
                print("Yes")
                f = 1
                break
if f == 0:
    print("No")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

L = []

for i in range(a):
    L.append([j for j in input()])

K = []

for i in range(b):
    K.append([j for j in input()])

for i in range(a-b+1):
    for j in range(a-b+1):
        if L[i][j] == K[0][0]:
            for k in range(b):
                if L[i+k][j:j+b] == K[i+k]:
                    continue
                else:
                    break
            if k == b - 1:
                print("Yes")
                quit()
print("No")

Fixed submission:
a, b = map(int, input().split())

A = []
for i in range(a):
    A.append(list(input()))
B = []
for i in range(b):
    B.append(list(input()))
f = 0
for i in range(a - b + 1):
    for j in range(a - b + 1):
        if A[i][j] == B[0][0]:
            ans = 0
            for k in range(b):
                for l in range(b):
                    if A[i+k][j+l] == B[k][l]:
                        continue
                    else:
                        ans = 1
            if ans == 0 and f == 0:
                print("Yes")
                f = 1
                break
if f == 0:
    print("No")