#include using namespace std; typedef long long ll; #define reps(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) reps(i,0,n) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define PI (acos(-1)) int main(){ int a,b; cin >> a >> b; if((a+b)%2==0){ cout << (a+b)/2 << endl; }else{ cout << -1 << endl; } }