function Main(input) {
    var parseInputs = parseInput(input);
    var result = isEqualityCheck(parseInputs);
    isBeautifulCheck(result);
}
var parseInput = function (input) {
    return input.split(" ");
};
var isEqualityCheck = function (parseInputs) {
    return (parseInputs[1] - parseInputs[0] === parseInputs[2] - parseInputs[1]);
};
var isBeautifulCheck = function (result) {
    console.log(result ? "YES" : "NO");
};

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
