N = int(eval(input()))

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

for k in range(1,N):

    if A[k-1] == A[k]:

        print("NO")

        exit(0)

print("YES")

N = int(eval(input()))

A = set(input().split())

if len(A) == N:

    print("YES")

else:

    print("NO")

N = int(eval(input()))
A = sorted(list(map(int, input().split())))
for k in range(1, N):
    if A[k - 1] == A[k]:
        print("NO")
        exit(0)
print("YES")

N = int(eval(input()))
A = set(input().split())
if len(A) == N:
    print("YES")
else:
    print("NO")

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