n, m = gets.split.map(&:to_i) if n <= m p 1 else p n % 2 == 0 && n / 2 <= m ? 2 : -1 end