getNums :: String -> [Int]
getNums xs = (read $ fst h :: Int) : case snd h of
                      [] -> []
                      (_:xs') -> getNums xs'
  where h = break (== ' ') xs

judgeNum :: [Int] -> String
judgeNum [a,b,c] = case b - a == c - b of
                    True -> "YES"
                    False -> "NO"


main = do
  str <- fmap (judgeNum.getNums) getLine :: IO String
  putStrLn str