n = int(eval(input()))

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



a.sort()



for i in range(n-1):

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

        print("NO")

        exit(0)



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

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

a_set = set(a)



if len(a) == len(a_set):

    print("YES")

else:

    print("NO")
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
for i in range(n - 1):
    if a[i] == a[i + 1]:
        print("NO")
        exit(0)
print("YES")

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

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