Rng is preparing a problem set for a qualification round of CODEFESTIVAL.  He has N candidates of problems. The difficulty of the i-th candidate is D_i.  There must be M problems in the problem set, and the difficulty of the i-th problem must be T_i. Here, one candidate of a problem cannot be used as multiple problems.  Determine whether Rng can complete the problem set without creating new candidates of problems.
from collections import Counter

n=int(input())
nl=sorted(list(map(int,input().split())))
m=int(input())
ml=sorted(list(map(int,input().split())))

cnl=Counter(nl)
cml=Counter(ml)

ans="Yes"

for i in cml.keys():
  if i  not in cnl.keys():
    ans="No"
  else:
    if cml[i] > cnl[i]:
      ans="No"
      break
      
print(ans)
from collections import Counter

n=int(input())
nl=sorted(list(map(int,input().split())))
m=int(input())
ml=sorted(list(map(int,input().split())))

cnl=Counter(nl)
cml=Counter(ml)

ans="YES"

for i in cml.keys():
  if i  not in cnl.keys():
    ans="NO"
  else:
    if cml[i] > cnl[i]:
      ans="NO"
      break
      
print(ans)