#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll i,j,k,p,n,m,t,ans=0,a,c,b;
   // string s,ss;
    cin>>a>>b>>c;
    if(abs(b-a)==abs(c-b))
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
}






