N = int(eval(input()))

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

ans = set()

for a in A:

    ans.add(a)

if len(ans) == N:

    print('YES')

else:

    print('NO')

N = int(eval(input()))

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

if len(A) == N:

    print('YES')

else:

    print('NO')

N = int(eval(input()))
A = list(map(int, input().split()))
ans = set()
for a in A:
    ans.add(a)
if len(ans) == N:
    print("YES")
else:
    print("NO")

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

-A = list(map(int, input().split())) -ans = set() -for a in A: -    ans.add(a) -if len(ans) == N: +A = set(map(int, input().split())) +if len(A) == N: