n = int(eval(input()))

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

m = int(eval(input()))

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



x = dict()

for i in d:

    x[i] = x.get(i, 0) + 1



y = dict()

for i in t:

    y[i] = y.get(i, 0) + 1



for i, j in list(y.items()):

    if x.get(i, 0) < j:

        print("NO")

        exit()

print("YES")

n = int(eval(input()))



x = dict()

for i in input().split():

    x[i] = x.get(i, 0) + 1



m = int(eval(input()))



y = dict()

for i in input().split():

    y[i] = y.get(i, 0) + 1



for i, j in list(y.items()):

    if x.get(i, 0) < j:

        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()))
x = dict()
for i in d:
    x[i] = x.get(i, 0) + 1
y = dict()
for i in t:
    y[i] = y.get(i, 0) + 1
for i, j in list(y.items()):
    if x.get(i, 0) < j:
        print("NO")
        exit()
print("YES")

n = int(eval(input()))
x = dict()
for i in input().split():
    x[i] = x.get(i, 0) + 1
m = int(eval(input()))
y = dict()
for i in input().split():
    y[i] = y.get(i, 0) + 1
for i, j in list(y.items()):
    if x.get(i, 0) < j:
        print("NO")
        exit()
print("YES")

-d = list(map(int, input().split())) +x = dict() +for i in input().split(): +    x[i] = x.get(i, 0) + 1 -t = list(map(int, input().split())) -x = dict() -for i in d: -    x[i] = x.get(i, 0) + 1 -for i in t: +for i in input().split():