import sys



N = int(eval(input()))

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



As.sort()

for i in range(N):

    for j in range(i + 1, N):

        if As[i] == As[j]:

            print('NO')

            sys.exit(0)

        if As[j] > As[i]:

            break



print('YES')
import sys



N = int(eval(input()))

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



A.sort()

for i in range(N - 1):

    if A[i] == A[i + 1]:

        print('NO')

        sys.exit(0)



print('YES')

import sys

N = int(eval(input()))
As = list(map(int, input().split()))
As.sort()
for i in range(N):
    for j in range(i + 1, N):
        if As[i] == As[j]:
            print("NO")
            sys.exit(0)
        if As[j] > As[i]:
            break
print("YES")

import sys

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
for i in range(N - 1):
    if A[i] == A[i + 1]:
        print("NO")
        sys.exit(0)
print("YES")

-As = list(map(int, input().split())) -As.sort() -for i in range(N): -    for j in range(i + 1, N): -        if As[i] == As[j]: -            print("NO") -            sys.exit(0) -        if As[j] > As[i]: -            break +A = list(map(int, input().split())) +A.sort() +for i in range(N - 1): +    if A[i] == A[i + 1]: +        print("NO") +        sys.exit(0)