#include using namespace std; int main( int argc, char *argv[] ) { int n; int m; ios::sync_with_stdio( false ); cin.tie( 0 ); cin >> n; cin >> m; if( n <= m ) cout << 1 << endl; else if( n % 2 == 0 && n <= 2 * m ) cout << 2 << endl; else cout << - 1 << endl; return 0; }