N = int(eval(input()))

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

M = int(eval(input()))

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



n = 0

for t in T:

    for i in range(n, N):

        if D[i] == t:

            n = i + 1

            break

        if D[i] > t:

            print('NO')

            exit()

        if i == N - 1:

            print('NO')

            exit()

print('YES')

from collections import Counter

N = int(eval(input()))

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

M = int(eval(input()))

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



for k, v in list(T.items()):

    if D[k] < v:

        print('NO')

        exit()

print('YES')

N = int(eval(input()))
D = sorted(map(int, input().split()))
M = int(eval(input()))
T = sorted(map(int, input().split()))
n = 0
for t in T:
    for i in range(n, N):
        if D[i] == t:
            n = i + 1
            break
        if D[i] > t:
            print("NO")
            exit()
        if i == N - 1:
            print("NO")
            exit()
print("YES")

from collections import Counter

N = int(eval(input()))
D = Counter(list(map(int, input().split())))
M = int(eval(input()))
T = Counter(list(map(int, input().split())))
for k, v in list(T.items()):
    if D[k] < v:
        print("NO")
        exit()
print("YES")

+from collections import Counter + -D = sorted(map(int, input().split())) +D = Counter(list(map(int, input().split()))) -T = sorted(map(int, input().split())) -n = 0 -for t in T: -    for i in range(n, N): -        if D[i] == t: -            n = i + 1 -            break -        if D[i] > t: -            print("NO") -            exit() -        if i == N - 1: -            print("NO") -            exit() +T = Counter(list(map(int, input().split()))) +for k, v in list(T.items()): +    if D[k] < v: +        print("NO") +        exit()