Problem:
Score : 100 points

Problem Statement

Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.
We will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.

Determine whether the arrangement of the poles is beautiful.

Constraints

1 \leq a,b,c \leq 100

a, b and c are integers.

Input

Input is given from Standard Input in the following format:

a b c

Output

Print YES if the arrangement of the poles is beautiful; print NO otherwise.

Sample Input 1

2 4 6

Sample Output 1

YES

Since 4-2 = 6-4, this arrangement of poles is beautiful.

Sample Input 2

2 5 6

Sample Output 2

NO

Since 5-2 \neq 6-5, this arrangement of poles is not beautiful.

Sample Input 3

3 2 1

Sample Output 3

YES

Since 1-2 = 2-3, this arrangement of poles is beautiful.

Solution in JavaScript (node.js v5.12) (judge verdict: Accepted)

process.stdin.resume();
process.stdin.setEncoding('utf8');
 
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がline1, 2行目がline2, …に入る
  var arg   = input.split("\n");
  var line0 = arg[0].split(" ");
//  var line1 = arg[1].split(" ");
//  var line2 = arg[2].split(" ");
//  var line3 = arg[3].split(" ");

  var a = Number(line0[0]);
  var b = Number(line0[1]);
  var c = Number(line0[2]);
//  var d = Number(line1[1]);

  var ans = "initial_answer";
  //console.log( "[INPUT] "+ input1 +" "+ input2 +" "+ input3 + " " + input4 );
  
  // LOGIC //
  ans = "NO";
  
  if(b-a == c-b) ans="YES";
  


  console.log(ans);

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));