import Data.List solve xs | any (== 0) xs' = "NO" | all (== head xs') xs' = "YES" | otherwise = "NO" where xs' = zipWith (-) (tail xs) (init xs) main = do getLine xs <- sort . map read . words <$> getLine putStrLn $ solve xs