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.
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t  =list(map(int,input().split()))

d = sorted(d)
t = sorted(t)

s = 0
k = 0
for i in t:
    while(1):
        if s == len(d):
            break
        if d[s] == i:
            s += 1
            k += 1
            break
        else:
            s += 1
        
    
if k == len(t):
    print("Yes")
else:
    print("No")
from collections import defaultdict

n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))

di = defaultdict(lambda: 0)

for i in d:
    di[i] += 1
      
ans = "YES" 
      
for i in t:
    if (i not in di) or (di[i] == 0):
        ans = "NO"
        break
    else:
        di[i] -= 1
         
print(ans)