N=int(eval(input()))

D=sorted(map(int,input().split()))[::-1]

M=int(eval(input()))

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

for t in T:

    d=0

    while D and d!=t:

        d=D.pop()

    if d!=t:

        print("NO")

        exit()

print("YES")
from collections import Counter

N=int(eval(input()))

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

M=int(eval(input()))

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

print(("YES" if all(D[key]>=value for key,value in list(T.items())) else "NO"))
N = int(eval(input()))
D = sorted(map(int, input().split()))[::-1]
M = int(eval(input()))
T = sorted(map(int, input().split()))
for t in T:
    d = 0
    while D and d != t:
        d = D.pop()
    if d != t:
        print("NO")
        exit()
print("YES")

from collections import Counter

N = int(eval(input()))
D = Counter(list(map(int, input().split())))
M = int(eval(input()))
T = Counter(list(map(int, input().split())))
print(("YES" if all(D[key] >= value for key, value in list(T.items())) else "NO"))

+from collections import Counter + -D = sorted(map(int, input().split()))[::-1] +D = Counter(list(map(int, input().split()))) -T = sorted(map(int, input().split())) -for t in T: -    d = 0 -    while D and d != t: -        d = D.pop() -    if d != t: -        print("NO") -        exit() -print("YES") +T = Counter(list(map(int, input().split()))) +print(("YES" if all(D[key] >= value for key, value in list(T.items())) else "NO"))