program main
  implicit none

  integer, parameter ::     i8 = selected_int_kind  ( 18 )

  integer ( kind = i8 ) :: nn, i, jdg
  integer ( kind = i8 ), allocatable, dimension ( : ) :: aa, rtn

  jdg = 1
  read *, nn
  allocate ( aa ( nn ) )

  read *, aa ( : )

  aa = iqsort ( aa )

  do i = 1, nn - 1
     if ( aa ( i + 1 ) == aa ( i ) ) then
        print *, "NO"
        jdg = -1
        exit
     end if
  end do

  if ( jdg == 1 ) then
     print *, "YES"
  end if
  
  
  
 contains
    recursive function iqsort ( ix ) result ( ires )
      integer ( 8 ), allocatable, dimension ( : ) :: ires
      integer ( 8 ),              dimension ( : ), intent(in)  :: ix
      integer :: k
      if ( size( ix ) <= 1 ) then 
        ires = ix
      else  
        k = ix ( size ( ix ) / 2 )
        ires = [ iqsort ( pack ( ix, ix < k ) ), pack ( ix, ix == k ), iqsort ( pack ( ix, ix > k ) ) ] 
      end if
    end function iqsort
    
end program main
