-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = print . solve . map read . words =<< getLine solve [n, m] | n - m <= 0 = 1 | odd n = -1 | div n 2 <= m = 2 | otherwise = -1