#include using namespace std; int main() { int A, B, C; cin >> A >> B; if (A != B) { C = (A + B) / 2; } if ((A + C) == 2 * B && (B + C) == 2 * A && A != C && B != C) { cout << C << endl; } else { cout << -1 << endl; } return 0; }