import Data.List(sort) main :: IO () main = getContents >>= putStrLn . checkList [] . sort . tail . map readInt . words readInt :: String -> Int readInt = read checkList :: [Int] -> [Int] -> String checkList (x:xs) [_] = if x /= 0 && all (x==) xs then "YES" else "NO" checkList cs (x:y:xs) = checkList (y-x:cs) (y:xs)