program test03
 implicit none
 integer N
 integer,allocatable :: A(:)
 integer i, j
 integer :: kotae=0

 read *, N
 allocate(A(N))
 read *, A

 do i=1,N-1
  do j=i,N
   if ( A(i) == A(j) .and. i /= j ) kotae=1
  end do
 end do

 if (kotae==0) print *, 'YES'
 if (kotae==1) print *, 'NO'


endprogram test03
