
import  scala.io.StdIn

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

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

}