using System; public class Hello { public static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var m = int.Parse(line[1]); if (m >= n) { Console.WriteLine(1); goto end; } int ans; if (n % 2 == 0 && m >= n / 2) ans = 2; else ans = -1; Console.WriteLine(ans); end:; } }