import Data.List

main = do
    getLine
    arr <- map read . words <$> getLine :: IO [Int]
    putStrLn $ if allUnique arr then "YES" else "NO"

allUnique :: Ord a => [a] -> Bool
allUnique = all ( (==) 1 . length) . group . sort
