from collections import Counter 



N=int(eval(input()))

C = Counter(list(map(int,input().split())))

O=int(eval(input()))

M = Counter(list(map(int,input().split())))

for key in list(M.keys()):

  if C[key]<M[key]:

    print("NO")

    break

else:

  print("YES")

from collections import Counter

N = int(eval(input()))

D=list(map(int,input().split()))

M = int(eval(input()))

T=list(map(int,input().split()))



C=Counter(D)



for t in T:

    if C[t]<=0:

        print("NO")

        exit()

    else:

        C[t]-=1

print("YES")

from collections import Counter

N = int(eval(input()))
C = Counter(list(map(int, input().split())))
O = int(eval(input()))
M = Counter(list(map(int, input().split())))
for key in list(M.keys()):
    if C[key] < M[key]:
        print("NO")
        break
else:
    print("YES")

from collections import Counter

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
C = Counter(D)
for t in T:
    if C[t] <= 0:
        print("NO")
        exit()
    else:
        C[t] -= 1
print("YES")

-C = Counter(list(map(int, input().split()))) -O = int(eval(input())) -M = Counter(list(map(int, input().split()))) -for key in list(M.keys()): -    if C[key] < M[key]: +D = list(map(int, input().split())) +M = int(eval(input())) +T = list(map(int, input().split())) +C = Counter(D) +for t in T: +    if C[t] <= 0: -        break -else: -    print("YES") +        exit() +    else: +        C[t] -= 1 +print("YES")