program main
integer::i,n,k
integer,allocatable::a(:),b(:)
read(*,*)n
allocate(a(n))
	read(*,*)a(:)
    k=maxval(a)
allocate(b(k))
b=0
do i=1,n
	b(a(i))=b(a(i))+1
end do
if(maxval(b)==1)then
	print*,'YES'
else
	print*,'NO'
end if
end program main


