fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: Vec = s.split_whitespace().flat_map(str::parse).collect(); println!( "{}", match n { _ if n[0] <= n[1] => 1, _ if n[0] % 2 == 0 && n[1] >= n[0] / 2 => 2, _ => -1, } ) }