package yukicoder; import java.util.Scanner; public class No531 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); if(n <= m) { System.out.println(1); } else if(n > m && n % 2 == 0) { System.out.println(n / m); } else { System.out.println(-1); } } }