# coding: utf-8
import collections
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
T_=list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg=True
for t in T_:
    #print(c[t], c2[t])
    if c[t] < c2[t]:
        flg=False
if flg:
    print("YES")
else:
    print("NO")
29923559fb5720ca1cf8ee57e3e8c22ec266ab80
<mask token>

<mask token>
for t in T_:
    if c[t] < c2[t]:
        flg = False
if flg:
    print('YES')
else:
    print('NO')

<mask token>
n = int(input())
D = list(map(int, input().split()))
m = int(input())
T = list(map(int, input().split()))
T_ = list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg = True
for t in T_:
    if c[t] < c2[t]:
        flg = False
if flg:
    print('YES')
else:
    print('NO')

import collections
n = int(input())
D = list(map(int, input().split()))
m = int(input())
T = list(map(int, input().split()))
T_ = list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg = True
for t in T_:
    if c[t] < c2[t]:
        flg = False
if flg:
    print('YES')
else:
    print('NO')

# coding: utf-8
import collections
n=int(input())
D=list(map(int,input().split()))
m=int(input())
T=list(map(int,input().split()))
T_=list(set(T))
c = collections.Counter(D)
c2 = collections.Counter(T)
flg=True
for t in T_:
    #print(c[t], c2[t])
    if c[t] < c2[t]:
        flg=False
if flg:
    print("YES")
else:
    print("NO")