import collections

N = int(eval(input()))

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





table = collections.defaultdict(int)

for x in A:

    table[x] += 1

    if table[x] > 1:

        print("NO")

        exit(0)

print("YES")

N = int(eval(input()))

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

if len(A) == N:

    print("YES")

else:

    print("NO")

import collections

N = int(eval(input()))
A = list(map(int, input().split()))
table = collections.defaultdict(int)
for x in A:
    table[x] += 1
    if table[x] > 1:
        print("NO")
        exit(0)
print("YES")

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

-import collections - -A = list(map(int, input().split())) -table = collections.defaultdict(int) -for x in A: -    table[x] += 1 -    if table[x] > 1: -        print("NO") -        exit(0) -print("YES") +A = set(list(map(int, input().split()))) +if len(A) == N: +    print("YES") +else: +    print("NO")