n = int(eval(input()))

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

for i in range(n-1):

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

        print("NO")

        exit()

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

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

if len(set(a))==len(a):

    print("YES")

else:

    print("NO")

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

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

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