module Main where import Control.Monad import Data.List (sort) main :: IO () main = do getLine xs <- sort . fmap read . words <$> getLine :: IO [Int] let bs@(b:_) = zip xs (drop 1 xs) let space = uncurry (-) b if (space /= 0) && (all (== space) $ fmap (uncurry (-)) bs) then putStrLn "YES" else putStrLn "NO"