#include <bits/stdc++.h>
using namespace std;
int a, n, sredina, tim1, tim2;
void invalidCheck() {
if (a == n || a < n) {
    cout << -1 << endl;
}
}

int main() {
cin >> a >> n;
invalidCheck();
return 0;
}