package test; import java.util.Scanner; public class Enu { 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(m%n==0){ System.out.println(m/n); }else{ System.out.println(-1); } } } }