#include<bits/stdc++.h>
using namespace std;
int a1,a2,a3;
int main(){
    cin>>a1>>a2>>a3;
    if(a1>a2)swap(a1,a2);
    if(a1>a3)swap(a1,a3);
    if(a2>a3)swap(a2,a3);
    cout<<(a3-a2==a2-a1?"Yes":"No");
}
#include <math.h>

#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() { int a, b, x, y;
    cin >> a >> b >> x >> y;
    if (a == b) cout << x << endl;
    else if(a>b){
        if (2 * x < y) cout << x * (2 * (a - b) - 1) << endl;
        else
            cout << (a - b - 1) * y + x << endl;
    }
    else {
        if (2 * x < y) cout << x * (2 * (b - a) + 1) << endl;
        else
            cout << (b - a) * y + x << endl;
    }
}