import Data.List
import Data.Bool
import Control.Monad
main = do
  n <- getLine
  xs <- (map read . words) <$> getLine :: IO [Int]
  putStrLn $ bool "NO" "YES" $ all ((== 1) . length) $ group $ sort xs
