import qualified Data.ByteString.Char8 as BS import Data.List import Data.Maybe main = BS.getContents >>= putStrLn . solve [] . sort . map (fst . fromJust . BS.readInt) . tail . BS.words solve ls [_] = if head ls /= 0 && all (== head ls) (tail ls) then "YES" else "NO" solve ls (a0:a1:as) = solve ((a0 - a1):ls) (a1:as)