N = int(eval(input()))

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

B = list(set(A))

print(('YES' if sorted(A) == sorted(B) else 'NO'))
N = int(eval(input()))

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

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

-A = list(map(int, input().split())) -B = list(set(A)) -print(("YES" if sorted(A) == sorted(B) else "NO")) +print(("YES" if N == len(set(input().split())) else "NO"))