#C

N = int(eval(input()))

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

ans = "YES"



for i in range(N-1):

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

        ans = "NO"

        break

        

print(ans)
N = int(eval(input()))

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

memo = {}

ans = "YES"



for a in A:

    if a in memo:

        ans = "NO"

        break

    memo[a] = None



print(ans)

# C
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
ans = "YES"
for i in range(N - 1):
    if A[i] == A[i + 1]:
        ans = "NO"
        break
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
memo = {}
ans = "YES"
for a in A:
    if a in memo:
        ans = "NO"
        break
    memo[a] = None
print(ans)

-# C -A = sorted(list(map(int, input().split()))) +A = list(map(int, input().split())) +memo = {} -for i in range(N - 1): -    if A[i] == A[i + 1]: +for a in A: +    if a in memo: +    memo[a] = None