from collections import Counter

n = int(eval(input()))

D = Counter(input().split())

m = int(eval(input()))

for i, j in list(Counter(input().split()).items()):

    if i not in D or D[i] < j:

        print("NO")

        exit()

print("YES")
from collections import Counter



eval(input())

d = Counter(input().split())

eval(input())

t = Counter(input().split())



if all(ti in d and d[ti] >= tc for ti, tc in list(t.items())):

    print("YES")

else:

    print("NO")
from collections import Counter

n = int(eval(input()))
D = Counter(input().split())
m = int(eval(input()))
for i, j in list(Counter(input().split()).items()):
    if i not in D or D[i] < j:
        print("NO")
        exit()
print("YES")

from collections import Counter

eval(input())
d = Counter(input().split())
eval(input())
t = Counter(input().split())
if all(ti in d and d[ti] >= tc for ti, tc in list(t.items())):
    print("YES")
else:
    print("NO")

-n = int(eval(input())) -D = Counter(input().split()) -m = int(eval(input())) -for i, j in list(Counter(input().split()).items()): -    if i not in D or D[i] < j: -        print("NO") -        exit() -print("YES") +eval(input()) +d = Counter(input().split()) +eval(input()) +t = Counter(input().split()) +if all(ti in d and d[ti] >= tc for ti, tc in list(t.items())): +    print("YES") +else: +    print("NO")