from collections import Counter

n=int(eval(input()))

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

m=int(eval(input()))

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



d_c=Counter(d)

t_c=Counter(t)

for i in list(t_c.keys()):

    if t_c[i]>d_c[i]:

        print('NO')

        exit()

print('YES')
from sys import stdin

nii=lambda:list(map(int,stdin.readline().split()))

lnii=lambda:list(map(int,stdin.readline().split()))

from collections import Counter



n=int(eval(input()))

d=lnii()

m=int(eval(input()))

t=lnii()



c=Counter(d)

for i in t:

  if c[i]==0:

    print('NO')

    exit()

  else:

    c[i]-=1



print('YES')
from collections import Counter

n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t = list(map(int, input().split()))
d_c = Counter(d)
t_c = Counter(t)
for i in list(t_c.keys()):
    if t_c[i] > d_c[i]:
        print("NO")
        exit()
print("YES")

from sys import stdin

nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
from collections import Counter

n = int(eval(input()))
d = lnii()
m = int(eval(input()))
t = lnii()
c = Counter(d)
for i in t:
    if c[i] == 0:
        print("NO")
        exit()
    else:
        c[i] -= 1
print("YES")

+from sys import stdin + +nii = lambda: list(map(int, stdin.readline().split())) +lnii = lambda: list(map(int, stdin.readline().split())) -d = list(map(int, input().split())) +d = lnii() -t = list(map(int, input().split())) -d_c = Counter(d) -t_c = Counter(t) -for i in list(t_c.keys()): -    if t_c[i] > d_c[i]: +t = lnii() +c = Counter(d) +for i in t: +    if c[i] == 0: +    else: +        c[i] -= 1