N = int(eval(input()))

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

M = int(eval(input()))

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

cur = 0

flag = 0

for i in range(N):

    if cur<M and D[i]==T[cur]:

        cur += 1

    elif cur<M and D[i]<T[cur]:

        continue

    elif cur==M:

        break

    else:

        flag = 1

        break

if flag==0:

    print("YES")

else:

    print("NO")
N = int(eval(input()))

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

CD = {}

for i in range(N):

    d = D[i]

    if d not in CD:

        CD[d] = 0

    CD[d] += 1

M = int(eval(input()))

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

CT = {}

for j in range(M):

    t = T[j]

    if t not in CT:

        CT[t] = 0

    CT[t] += 1

flag = 0

for t in CT:

    if t not in CD:

        flag = 1

        break

    else:

        if CT[t]>CD[t]:

            flag = 1

            break

if flag==0:

    print("YES")

else:

    print("NO")
N = int(eval(input()))
D = sorted(list(map(int, input().split())))
M = int(eval(input()))
T = sorted(list(map(int, input().split())))
cur = 0
flag = 0
for i in range(N):
    if cur < M and D[i] == T[cur]:
        cur += 1
    elif cur < M and D[i] < T[cur]:
        continue
    elif cur == M:
        break
    else:
        flag = 1
        break
if flag == 0:
    print("YES")
else:
    print("NO")

N = int(eval(input()))
D = list(map(int, input().split()))
CD = {}
for i in range(N):
    d = D[i]
    if d not in CD:
        CD[d] = 0
    CD[d] += 1
M = int(eval(input()))
T = list(map(int, input().split()))
CT = {}
for j in range(M):
    t = T[j]
    if t not in CT:
        CT[t] = 0
    CT[t] += 1
flag = 0
for t in CT:
    if t not in CD:
        flag = 1
        break
    else:
        if CT[t] > CD[t]:
            flag = 1
            break
if flag == 0:
    print("YES")
else:
    print("NO")

-D = sorted(list(map(int, input().split()))) +D = list(map(int, input().split())) +CD = {} +for i in range(N): +    d = D[i] +    if d not in CD: +        CD[d] = 0 +    CD[d] += 1 -T = sorted(list(map(int, input().split()))) -cur = 0 +T = list(map(int, input().split())) +CT = {} +for j in range(M): +    t = T[j] +    if t not in CT: +        CT[t] = 0 +    CT[t] += 1 -for i in range(N): -    if cur < M and D[i] == T[cur]: -        cur += 1 -    elif cur < M and D[i] < T[cur]: -        continue -    elif cur == M: +for t in CT: +    if t not in CD: +        flag = 1 -        flag = 1 -        break +        if CT[t] > CD[t]: +            flag = 1 +            break