dic={}

n=int(eval(input()))

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

for i in range(len(lis)):

    if dic.get(lis[i],0)==0:

        dic[lis[i]]=1

    else:

        print("NO")

        exit()

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

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

if len(l)==len(set(l)):

    print("YES")

else:print("NO")

dic = {}
n = int(eval(input()))
lis = list(map(int, input().split()))
for i in range(len(lis)):
    if dic.get(lis[i], 0) == 0:
        dic[lis[i]] = 1
    else:
        print("NO")
        exit()
print("YES")

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

-dic = {} -n = int(eval(input())) -lis = list(map(int, input().split())) -for i in range(len(lis)): -    if dic.get(lis[i], 0) == 0: -        dic[lis[i]] = 1 -    else: -        print("NO") -        exit() -print("YES") +n = eval(input()) +l = list(map(int, input().split())) +if len(l) == len(set(l)): +    print("YES") +else: +    print("NO")