Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in D:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')

Fixed submission:
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
sd = set(D)
st = set(T)
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in sd:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*(10**9+5)
numt = [0]*(10**9+5)
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')

Fixed submission:
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
sd = set(D)
st = set(T)
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in sd:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*(10**9+5)
numt = [0]*(10**9+5)
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')

Fixed submission:
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
sd = set(D)
st = set(T)
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in sd:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*200005
numt = [0]*200005
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')

Fixed submission:
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
sd = set(D)
st = set(T)
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in sd:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
= list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*200005
numt = [0]*200005
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')

Fixed submission:
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
sd = set(D)
st = set(T)
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in sd:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
for i in range(m):
    if T[i] in D:
        del D[D.index(T[i])]
    else:
        print('NO')
        exit()
print('YES')

Fixed submission:
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
sd = set(D)
st = set(T)
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in sd:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')