import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); scan.close(); if(m >= n) { System.out.println(1); }else { if(n == 4 && m == 3) { System.out.println(3); }else if(n == 5 && (m == 3 || m == 4)) { System.out.println(3); } System.out.println(-1); } } }