#include int main(void){ using namespace std; int a,b; cin >> a >> b; //cout << a << b << endl; if(a==-1)cout << 2 << endl; if(b==0)cout << 1 << endl; if((a!=-1)&&(b!=0)) cout << -1 << endl; return 0; }