
import Control.Monad
import Data.List

main = do
    n <- readLn :: IO Int
    an <- map read . words <$> getLine :: IO [Int]
    putStrLn $ if any (\x -> 1 < (length x)) $ group $ sort an
                    then "NO"
                    else "YES"
