import sys

from collections import Counter

input = sys.stdin.readline



n = int(eval(input()))

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

m = int(eval(input()))

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

dif = sorted(list(Counter(d).items()))

check = sorted(list(Counter(t).items()))

cnt = 0

len_check = len(check)

for i, j in dif:

    if i == check[cnt][0]:

        if j >= check[cnt][1]:

            cnt += 1

        else:

            print('NO')

            exit()

    if cnt == len_check:

        print('YES')

        exit()

print('NO')

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(10 ** 7)



from collections import Counter



n = int(readline())

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

m, *t = list(map(int, read().split()))

d = Counter(d)

for k, v in list(Counter(t).items()):

    if d[k] < v:

        print('NO')

        break

else:

    print('YES')

import sys
from collections import Counter

input = sys.stdin.readline
n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t = list(map(int, input().split()))
dif = sorted(list(Counter(d).items()))
check = sorted(list(Counter(t).items()))
cnt = 0
len_check = len(check)
for i, j in dif:
    if i == check[cnt][0]:
        if j >= check[cnt][1]:
            cnt += 1
        else:
            print("NO")
            exit()
    if cnt == len_check:
        print("YES")
        exit()
print("NO")

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**7)
from collections import Counter

n = int(readline())
d = list(map(int, readline().split()))
m, *t = list(map(int, read().split()))
d = Counter(d)
for k, v in list(Counter(t).items()):
    if d[k] < v:
        print("NO")
        break
else:
    print("YES")

+ +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +sys.setrecursionlimit(10**7) -input = sys.stdin.readline -n = int(eval(input())) -d = list(map(int, input().split())) -m = int(eval(input())) -t = list(map(int, input().split())) -dif = sorted(list(Counter(d).items())) -check = sorted(list(Counter(t).items())) -cnt = 0 -len_check = len(check) -for i, j in dif: -    if i == check[cnt][0]: -        if j >= check[cnt][1]: -            cnt += 1 -        else: -            print("NO") -            exit() -    if cnt == len_check: -        print("YES") -        exit() -print("NO") +n = int(readline()) +d = list(map(int, readline().split())) +m, *t = list(map(int, read().split())) +d = Counter(d) +for k, v in list(Counter(t).items()): +    if d[k] < v: +        print("NO") +        break +else: +    print("YES")