import math

import sys

import collections 

N=int(eval(input()))

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

M=int(eval(input()))

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

new_D=sorted(D)

new_T=sorted(T)

a=collections.Counter(new_D)

b=collections.Counter(new_T)

#print(a[10])

#print(new_D[0])

for i in new_T:

    if a[i]<b[i]:

        print("NO")

        sys.exit()

    

    

print("YES")
import collections

import sys

N=int(eval(input()))

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

M=int(eval(input()))

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

D_count=collections.Counter(D)

T_count=collections.Counter(T)

for i in T:

    if D_count[i]<T_count[i]:

        print("NO")

        sys.exit()

print("YES")
import math
import sys
import collections

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
new_D = sorted(D)
new_T = sorted(T)
a = collections.Counter(new_D)
b = collections.Counter(new_T)
# print(a[10])
# print(new_D[0])
for i in new_T:
    if a[i] < b[i]:
        print("NO")
        sys.exit()
print("YES")

import collections
import sys

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
D_count = collections.Counter(D)
T_count = collections.Counter(T)
for i in T:
    if D_count[i] < T_count[i]:
        print("NO")
        sys.exit()
print("YES")

-import math +import collections -import collections -new_D = sorted(D) -new_T = sorted(T) -a = collections.Counter(new_D) -b = collections.Counter(new_T) -# print(a[10]) -# print(new_D[0]) -for i in new_T: -    if a[i] < b[i]: +D_count = collections.Counter(D) +T_count = collections.Counter(T) +for i in T: +    if D_count[i] < T_count[i]: