N = int(eval(input()))

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

M = int(eval(input()))

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



if N < M:

    print('NO')

else:

    D.sort()

    T.sort()

    cnt = 0

    i = 0

    for t in T:

        while i < N:

            if D[i] == t:

                cnt += 1

                i += 1

                break

            i += 1

    if cnt == M: print('YES')

    else: print('NO')
N = int(eval(input()))

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

M = int(eval(input()))

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



from collections import Counter

cD = Counter(D)

cT = Counter(T)



ans = 'YES'

for k in cT:

    if (k not in list(cD.keys())) or (cT[k] > cD[k]):

        ans = 'NO'

        break

print(ans)
N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
if N < M:
    print("NO")
else:
    D.sort()
    T.sort()
    cnt = 0
    i = 0
    for t in T:
        while i < N:
            if D[i] == t:
                cnt += 1
                i += 1
                break
            i += 1
    if cnt == M:
        print("YES")
    else:
        print("NO")

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
from collections import Counter

cD = Counter(D)
cT = Counter(T)
ans = "YES"
for k in cT:
    if (k not in list(cD.keys())) or (cT[k] > cD[k]):
        ans = "NO"
        break
print(ans)

-if N < M: -    print("NO") -else: -    D.sort() -    T.sort() -    cnt = 0 -    i = 0 -    for t in T: -        while i < N: -            if D[i] == t: -                cnt += 1 -                i += 1 -                break -            i += 1 -    if cnt == M: -        print("YES") -    else: -        print("NO") +from collections import Counter + +cD = Counter(D) +cT = Counter(T) +ans = "YES" +for k in cT: +    if (k not in list(cD.keys())) or (cT[k] > cD[k]): +        ans = "NO" +        break +print(ans)