from collections import Counter

 

N = int(eval(input()))

D = list(input().split())

 

M = int(eval(input()))

T = list(input().split())

 

D_count = Counter(D)

T_count = Counter(T)



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

    if D_count[k] < v:

        print('NO')

        exit()

 

print('YES')

           
N = int(eval(input()))

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



M = int(eval(input()))

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



memo = {}



for d in D:

    if d in memo:

        memo[d] += 1

    else:

        memo[d] = 1

        

for t in T:

    if t in memo and 0 < memo[t]:

        memo[t] -= 1

    else:

        print('NO')

        exit()

print('YES')

from collections import Counter

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

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
memo = {}
for d in D:
    if d in memo:
        memo[d] += 1
    else:
        memo[d] = 1
for t in T:
    if t in memo and 0 < memo[t]:
        memo[t] -= 1
    else:
        print("NO")
        exit()
print("YES")

-from collections import Counter - -D = list(input().split()) +D = list(map(int, input().split())) -T = list(input().split()) -D_count = Counter(D) -T_count = Counter(T) -for k, v in list(T_count.items()): -    if D_count[k] < v: +T = list(map(int, input().split())) +memo = {} +for d in D: +    if d in memo: +        memo[d] += 1 +    else: +        memo[d] = 1 +for t in T: +    if t in memo and 0 < memo[t]: +        memo[t] -= 1 +    else: