Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
b=list(map(int,input().split()))
c=int(input())
d=list(map(int,input().split()))
e=set(d)

for item in e:
  if d.count(item)>b.count(item):
    print("NO")
    exit()
    
print("YES")


Fixed submission:
import collections

a=int(input())
b=collections.Counter(list(map(int,input().split())))
c=int(input())
d=collections.Counter(list(map(int,input().split())))
e=set(d)

for item in e:
  if d[item]>b[item]:
    print("NO")
    exit()
    
print("YES")

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
c=int(input())
d=list(map(int,input().split()))
e=set(d)

for item in e:
  if d.count(item)>c.count(item):
    print("NO")
    exit()
    
print("YES")

Fixed submission:
import collections

a=int(input())
b=collections.Counter(list(map(int,input().split())))
c=int(input())
d=collections.Counter(list(map(int,input().split())))
e=set(d)

for item in e:
  if d[item]>b[item]:
    print("NO")
    exit()
    
print("YES")

Buggy python submission (verdict: Runtime Error):
n=int(input())
r=list(map(int,input().split()))
m=int(input())
d=list(map(int,input().split()))
e=set(d)

from collections import Counter
n=counter(n)
d=counter(d)

for item in e:
  if r[item]<d[item]:
    print("NO")
    exit()
print("YES")


Fixed submission:
import collections

a=int(input())
b=collections.Counter(list(map(int,input().split())))
c=int(input())
d=collections.Counter(list(map(int,input().split())))
e=set(d)

for item in e:
  if d[item]>b[item]:
    print("NO")
    exit()
    
print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
r=list(map(int,input().split()))
m=int(input())
d=list(map(int,input().split()))
e=set(d)

for item in e:
  if r.count(item)<d.count(item):
    print("NO")
    exit()
print("YES")


Fixed submission:
import collections

a=int(input())
b=collections.Counter(list(map(int,input().split())))
c=int(input())
d=collections.Counter(list(map(int,input().split())))
e=set(d)

for item in e:
  if d[item]>b[item]:
    print("NO")
    exit()
    
print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
r=list(map(int,input().split()))
m=int(input())
d=list(map(int,input().split()))
e=set(d)

for item in e:
  if r.count(item)<d.count(item):
    print("NO")
    exit()
print("YES")


Fixed submission:
import collections

a=int(input())
b=collections.Counter(list(map(int,input().split())))
c=int(input())
d=collections.Counter(list(map(int,input().split())))
e=set(d)

for item in e:
  if d[item]>b[item]:
    print("NO")
    exit()
    
print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
r=sorted(list(map(int,input().split())))
m=int(input())
d=sorted(list(map(int,input().split())))

for item in d:
  if item in r:
    r.remove(item)
  else:
    print("NO")
    exit()
print("YES")


Fixed submission:
import collections

a=int(input())
b=collections.Counter(list(map(int,input().split())))
c=int(input())
d=collections.Counter(list(map(int,input().split())))
e=set(d)

for item in e:
  if d[item]>b[item]:
    print("NO")
    exit()
    
print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
r=list(map(int,input().split()))
m=int(input())
d=list(map(int,input().split()))

for item in d:
  if item in r:
    r.remove(item)
  else:
    print("NO")
    exit()
print("YES")

Fixed submission:
import collections

a=int(input())
b=collections.Counter(list(map(int,input().split())))
c=int(input())
d=collections.Counter(list(map(int,input().split())))
e=set(d)

for item in e:
  if d[item]>b[item]:
    print("NO")
    exit()
    
print("YES")