#include typedef long long int ll; using namespace std; ll N,M; int main(){ ios::sync_with_stdio(false); cin>>N>>M; if(N<=M)cout<<"1"; else if(N==M*2)cout<<"2"; else cout<<"-1"; return 0; }