import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); String[] str = s.nextLine().split(" "); int n = Integer.parseInt(str[0]); int m =Integer.parseInt(str[1]); if(m>=n){ System.out.println(1); }else{ if(n%m<=m){ System.out.println(n/m); }else { System.out.println(-1); } } } }