import collections

import sys

N = eval(input())

A = input().split()

A1 = list(map(int,list(collections.Counter(A).values())))

for i in A1:

    if i >= 2:

        print('NO')

        sys.exit()

print('YES')
import sys

N = int(eval(input()))

A = input().split()

if N > len(set(A)):

    print('NO')

    sys.exit()

print('YES')
import collections
import sys

N = eval(input())
A = input().split()
A1 = list(map(int, list(collections.Counter(A).values())))
for i in A1:
    if i >= 2:
        print("NO")
        sys.exit()
print("YES")

import sys

N = int(eval(input()))
A = input().split()
if N > len(set(A)):
    print("NO")
    sys.exit()
print("YES")

-import collections -N = eval(input()) +N = int(eval(input())) -A1 = list(map(int, list(collections.Counter(A).values()))) -for i in A1: -    if i >= 2: -        print("NO") -        sys.exit() +if N > len(set(A)): +    print("NO") +    sys.exit()