import Control.Applicative
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Char (isSpace)

main :: IO ()
main = getLine >> solve <$> f >>= putStrLn
  where
    f = readil B.readInt <$> B.getLine

solve :: [Int] -> String
solve xs =
  let ss = sort xs in
  case find f $ zip ss $ tail ss of
   Just _ -> "NO"
   Nothing -> "YES"
  where
    f (a, b) = a == b

readil :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> [a]
readil f = unfoldr $ \s -> do
  (n, s') <- f s
  return (n, B.dropWhile isSpace s')
