n = int(eval(input()))

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



mou = set([])

for i in range(n):

    if a[i] not in mou:

        mou.add(a[i])

    else:

        print('NO')

        exit()

print('YES')
n = int(eval(input()))

a = set(map(int, input().split()))



if n == len(a):

    print('YES')

else:

    print('NO')
n = int(eval(input()))
a = list(map(int, input().split()))
mou = set([])
for i in range(n):
    if a[i] not in mou:
        mou.add(a[i])
    else:
        print("NO")
        exit()
print("YES")

n = int(eval(input()))
a = set(map(int, input().split()))
if n == len(a):
    print("YES")
else:
    print("NO")

-a = list(map(int, input().split())) -mou = set([]) -for i in range(n): -    if a[i] not in mou: -        mou.add(a[i]) -    else: -        print("NO") -        exit() -print("YES") +a = set(map(int, input().split())) +if n == len(a): +    print("YES") +else: +    print("NO")