n, m = gets.split.map(&:to_i) if m >= n puts 1 end if m/2 >= n && n%2 == 0 puts 2; end puts -1