readNumbers :: String -> [Int]
readNumbers = map read . words

checkCondition :: Int -> Int -> Int -> String
checkCondition a b c
 | b - a == c - b = "YES"
 | otherwise = "NO"

main :: IO ()
main = do
    inpLine <- getLine
    let inpArr = readNumbers inpLine
    putStrLn (checkCondition (inpArr!!0) (inpArr!!1) (inpArr!!2))
