import sys



N = int(eval(input()))

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





D = {}



for i in range(N):

    e = A[i]

    if not(e in D):

        D[e] = 1

    else:

        D[e] = D[e] + 1



for key in D:

    if D[key]>=2:

        print("NO")

        sys.exit()

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

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



if len(set(A))==len(A):

    print("YES")

else:

    print("NO")
import sys

N = int(eval(input()))
(*A,) = list(map(int, input().split()))
D = {}
for i in range(N):
    e = A[i]
    if not (e in D):
        D[e] = 1
    else:
        D[e] = D[e] + 1
for key in D:
    if D[key] >= 2:
        print("NO")
        sys.exit()
print("YES")

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

-import sys - -D = {} -for i in range(N): -    e = A[i] -    if not (e in D): -        D[e] = 1 -    else: -        D[e] = D[e] + 1 -for key in D: -    if D[key] >= 2: -        print("NO") -        sys.exit() -print("YES") +if len(set(A)) == len(A): +    print("YES") +else: +    print("NO")