#include using namespace std; int main(){ int n,m; cin>>n>>m; if(n>m){ cout<<-1<=(m+1)/2){ cout<<2<