#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; constexpr int INF = 2e9; int main() { int a, b; cin >> a >> b; if (b == 0) { cout << 1 << endl; return 0; } if (a > 0) { cout << -1 << endl; return 0; } if (a * b + b == 0) { cout << 2 << endl; } else cout << -1 << endl; return 0; }