#38 B - Problem Set

import collections

N = int(eval(input()))

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

M = int(eval(input()))

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



cntD = collections.Counter(D)

cntT = collections.Counter(T)



result = 'YES'

for t in list(cntT.keys()):

    if not(t in cntD):

        result = 'NO'

        break

    if cntT[t] > cntD[t]:

        result = 'NO'

        break

print(result)
import collections

N = int(eval(input()))

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

M = int(eval(input()))

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



cntD = collections.Counter(D)

cntT = collections.Counter(T)



result = 'YES'

for t in list(cntT.keys()):

    if cntT[t] > cntD[t]:

        result = 'NO'

        break

print(result)
# 38 B - Problem Set
import collections

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
cntD = collections.Counter(D)
cntT = collections.Counter(T)
result = "YES"
for t in list(cntT.keys()):
    if not (t in cntD):
        result = "NO"
        break
    if cntT[t] > cntD[t]:
        result = "NO"
        break
print(result)

import collections

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
cntD = collections.Counter(D)
cntT = collections.Counter(T)
result = "YES"
for t in list(cntT.keys()):
    if cntT[t] > cntD[t]:
        result = "NO"
        break
print(result)

-# 38 B - Problem Set -    if not (t in cntD): -        result = "NO" -        break