from collections import Counter,defaultdict,deque

import sys,heapq,bisect,math,itertools,string,queue

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



n = inp()

d = inpl()

m = inp()

t = inpl()

cntd = Counter(d)

cntt = Counter(t)

for key in cntt:

    if cntt[key] > cntd[key]:

        print('NO')

        break

else:

    print('YES')
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n = inp()

a = inpl()

m = inp()

b = inpl()

ca = Counter(a)

cb = Counter(b)

for key in list(cb):

    if cb[key] > ca[key]:

        print('NO')

        break

else:

    print('YES')
from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpl_str():
    return list(sys.stdin.readline().split())


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


n = inp()
d = inpl()
m = inp()
t = inpl()
cntd = Counter(d)
cntt = Counter(t)
for key in cntt:
    if cntt[key] > cntd[key]:
        print("NO")
        break
else:
    print("YES")

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n = inp()
a = inpl()
m = inp()
b = inpl()
ca = Counter(a)
cb = Counter(b)
for key in list(cb):
    if cb[key] > ca[key]:
        print("NO")
        break
else:
    print("YES")

-import sys, heapq, bisect, math, itertools, string, queue +from heapq import heappop, heappush +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint +INF = float("inf") -def inpl_str(): -    return list(sys.stdin.readline().split()) - - -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -d = inpl() +a = inpl() -t = inpl() -cntd = Counter(d) -cntt = Counter(t) -for key in cntt: -    if cntt[key] > cntd[key]: +b = inpl() +ca = Counter(a) +cb = Counter(b) +for key in list(cb): +    if cb[key] > ca[key]: