n = int(eval(input()))

a = [int(i) for i in input().split()]



a.sort()

for i in range(n-1):

    if a[i] == a[i+1]:

        print("NO")

        exit()



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

a = [int(i) for i in input().split()]



aset = set(a)

print(("YES" if len(a) == len(aset) else "NO"))
n = int(eval(input()))
a = [int(i) for i in input().split()]
a.sort()
for i in range(n - 1):
    if a[i] == a[i + 1]:
        print("NO")
        exit()
print("YES")

n = int(eval(input()))
a = [int(i) for i in input().split()]
aset = set(a)
print(("YES" if len(a) == len(aset) else "NO"))

-a.sort() -for i in range(n - 1): -    if a[i] == a[i + 1]: -        print("NO") -        exit() -print("YES") +aset = set(a) +print(("YES" if len(a) == len(aset) else "NO"))