import java.util.Scanner; public class Main{ private static Scanner sc=new Scanner(System.in); public static void main(String args[])throws Exception{ int a=sc.nextInt(),b=sc.nextInt(); if(b%a==0)System.out.println(b/a); else System.out.println(-1); } }