let inpt = readLine()!.split(separator: " ").map({Int($0)!}) if inpt[1]>=inpt[0] { print(1) } else if(inpt[0] % 2 == 0 && inpt[1] >= inpt[0] / 2) { print(2) } else { print(-1) }