Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
d={}
t={}
for d_ in D:
    if str(d_) in d:
        d[str(d_)]+=1
    else:
        d[str(d_)] = 1
for t_ in T:
    if str(t_) in t:
        t[str(t_)]+=1
    else:
        t[str(t_)] = 1

D_=list(set(D))
T_=list(set(T))
flg=True
#print(T_,D_)
if len(T) > len(D) or len(T_) > len(D_):
    flg=False
if flg:
    for t_ in T_:
        #print(t_)
        #print(t[str(t_)], d[str(t_)])
        if t[str(t_)] <= d[str(t_)]:
            pass
        else:
            flg=False
if flg:
    print("YES")
else:
    print("NO")

Fixed submission:
# coding: utf-8
import collections
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
T_=list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg=True
for t in T_:
    #print(c[t], c2[t])
    if c[t] < c2[t]:
        flg=False
if flg:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
d={}
t={}
for d_ in D:
    if str(d_) in d:
        d[str(d_)]+=1
    else:
        d[str(d_)] = 1
for t_ in T:
    if str(t_) in t:
        t[str(t_)]+=1
    else:
        t[str(t_)] = 1

D_=list(set(D))
T_=list(set(T))
flg=True
if len(T_) > len(D_):
    flg=False
if flg:
    for t_ in T_:
        #print(t_)
        #print(t[str(t_)], d[str(t_)])
        if t[str(t_)] <= d[str(t_)]:
            pass
        else:
            flg=False
if flg:
    print("YES")
else:
    print("NO")

Fixed submission:
# coding: utf-8
import collections
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
T_=list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg=True
for t in T_:
    #print(c[t], c2[t])
    if c[t] < c2[t]:
        flg=False
if flg:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
d={}
t={}
for d_ in D:
    if str(d_) in d:
        d[str(d_)]+=1
    else:
        d[str(d_)] = 1
for t_ in T:
    if str(t_) in t:
        t[str(t_)]+=1
    else:
        t[str(t_)] = 1

D_=list(set(D))
T_=list(set(T))
flg=True
for a in T_:
    if a not in D_:
        flg=False
if flg:
    for t_ in list(set(T)):
        #print(t_)
        #print(t[str(t_)], d[str(t_)])
        if t[str(t_)] <= d[str(t_)]:
            pass
        else:
            flg=False
if flg:
    print("YES")
else:
    print("NO")

Fixed submission:
# coding: utf-8
import collections
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
T_=list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg=True
for t in T_:
    #print(c[t], c2[t])
    if c[t] < c2[t]:
        flg=False
if flg:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
d={}
t={}
for d_ in D:
    if str(d_) in d:
        d[str(d_)]+=1
    else:
        d[str(d_)] = 1
for t_ in T:
    if str(t_) in t:
        t[str(t_)]+=1
    else:
        t[str(t_)] = 1

D_=list(set(D))
T_=list(set(T))
flg=True
for a in T_:
    if a not in D_:
        flg=False
if flg:
    for t_ in list(set(T)):
        #print(t_)
        #print(t[str(t_)], d[str(t_)])
        if t[str(t_)] <= d[str(t_)]:
            pass
        else:
            flg=False
if flg:
    print("YES")
else:
    print("NO")

Fixed submission:
# coding: utf-8
import collections
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
T_=list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg=True
for t in T_:
    #print(c[t], c2[t])
    if c[t] < c2[t]:
        flg=False
if flg:
    print("YES")
else:
    print("NO")