N=int(eval(input()))

A=input().split()

S={}

for a in A:

  if a in list(S.keys()):

    print('NO')

    break

  S[a]=1

else:

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

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

print(('YES' if len(a)==len(set(a)) else 'NO'))

N = int(eval(input()))
A = input().split()
S = {}
for a in A:
    if a in list(S.keys()):
        print("NO")
        break
    S[a] = 1
else:
    print("YES")

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

-N = int(eval(input())) -A = input().split() -S = {} -for a in A: -    if a in list(S.keys()): -        print("NO") -        break -    S[a] = 1 -else: -    print("YES") +n = int(eval(input())) +a = list(map(int, input().split())) +print(("YES" if len(a) == len(set(a)) else "NO"))