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