#include #define PI 3.14159265359 #define NIL -1 using namespace std; const int64_t MOD = 1e9 + 7; int main() { int n, m; cin >> n >> m; if (n <= m) { cout << 1 << endl; return 0; } else { if (n % 2) { cout << -1 << endl; return 0; } else { if ((n % 2 == 0) && (n / 2 == m)) { cout << 4 << endl; return 0; } } } cout << 1 << endl; return 0; }