import  scala.io.StdIn

object Main extends App {
  val lites = StdIn.readLine()

  lites.split(" ").map(_.toInt) match {
    case Array(a, b, c) if(b -a == c- b) => println("YES")
    case _ => println("NO")
  }

}
