Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

for i in range(n - m):
    for j in range(n - m + 1):
        t = True
        for k in range(m):
            #print(dat_a[i + k][j:j+m])
            #print(dat_b[k])
            if dat_a[i + k][j:j+m] != dat_b[k]:
                t = False
                continue
            if t:
                break
        if t:
            break
    if t:
        break

print("Yes" if t else "No")

Fixed submission:
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

if n == 1 and m == 1:
    if dat_a[0][0] == dat_b[0][0]:
        t = True
    else:
        t = False

for i in range(n - m + 1):
    for j in range(n - m + 1):
        for k in range(m):
            #print(dat_a[i + k][j : j + m])
            if dat_a[i + k][j : j + m] != dat_b[k]:
                t = False
                break
            t = True
        if t:
            break
    if t:
        break

print("Yes" if t else "No")

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

for i in range(n - m):
    t = True
    for j in range(n - m):
        for k in range(m):
            if dat_a[i+ k][j:j+m] != dat_b[k]:
                t = False
                continue
        if t:
            break
    if t:
        break

print("Yes" if t else "No")

Fixed submission:
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

if n == 1 and m == 1:
    if dat_a[0][0] == dat_b[0][0]:
        t = True
    else:
        t = False

for i in range(n - m + 1):
    for j in range(n - m + 1):
        for k in range(m):
            #print(dat_a[i + k][j : j + m])
            if dat_a[i + k][j : j + m] != dat_b[k]:
                t = False
                break
            t = True
        if t:
            break
    if t:
        break

print("Yes" if t else "No")

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

for i in range(n - m):
    t = True
    for j in range(n - m):
        for k in range(m):
            if dat_a[i+ k][j:j+m] != dat_b[k]:
                t = False
                continue
    if t:
        break
print("Yes" if t else "No")

Fixed submission:
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

if n == 1 and m == 1:
    if dat_a[0][0] == dat_b[0][0]:
        t = True
    else:
        t = False

for i in range(n - m + 1):
    for j in range(n - m + 1):
        for k in range(m):
            #print(dat_a[i + k][j : j + m])
            if dat_a[i + k][j : j + m] != dat_b[k]:
                t = False
                break
            t = True
        if t:
            break
    if t:
        break

print("Yes" if t else "No")

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())
for i in range(n - m):
    t = True
    for j in range(n - m):
        for k in range(m):
            #print(dat_a[i + k][j:j+m])
            #print(dat_b[k])
            if dat_a[i+ k][j:j+m] != dat_b[k]:
                t = False
                break
        if t:
            break
    if t:
        break
print("Yes" if t else "No")

Fixed submission:
n, m = map(int, input().split())
dat_a = []
dat_b = []
for i in range(n):
    dat_a.append(input())
for i in range(m):
    dat_b.append(input())

if n == 1 and m == 1:
    if dat_a[0][0] == dat_b[0][0]:
        t = True
    else:
        t = False

for i in range(n - m + 1):
    for j in range(n - m + 1):
        for k in range(m):
            #print(dat_a[i + k][j : j + m])
            if dat_a[i + k][j : j + m] != dat_b[k]:
                t = False
                break
            t = True
        if t:
            break
    if t:
        break

print("Yes" if t else "No")