N, M = gets.split.map &:to_i if N <= M p 1 elsif N % 2 == 0 && N / 2 <= M p 2 else p -1 end