#pragma warning disable IDE0011 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Numerics; class ReaderWriter { protected int _Index; protected string[] _Line; public void R(char sep = ' ') { _Line = Console.ReadLine().Split(sep); _Index = 0; } public string S() => _Line[_Index++]; public string[] Ss() => _Line.Skip(_Index++).ToArray(); public char C() => char.Parse(_Line[_Index++]); public char[] Cs() => _Line.Skip(_Index++).Select(char.Parse).ToArray(); public int I() => int.Parse(_Line[_Index++]); public int[] Is() => _Line.Skip(_Index++).Select(int.Parse).ToArray(); public long L() => long.Parse(_Line[_Index++]); public long[] Ls() => _Line.Skip(_Index++).Select(long.Parse).ToArray(); public double F() => double.Parse(_Line[_Index++]); public double[] Fs() => _Line.Skip(_Index++).Select(double.Parse).ToArray(); public decimal D() => decimal.Parse(_Line[_Index++]); public decimal[] Ds() => _Line.Skip(_Index++).Select(decimal.Parse).ToArray(); public BigInteger B() => BigInteger.Parse(_Line[_Index++]); public BigInteger[] Bs() => _Line.Skip(_Index++).Select(BigInteger.Parse).ToArray(); public void Write(params object[] xs) { Console.Write(xs.First()); foreach (var x in xs.Skip(1)) Console.Write(" " + x); Console.WriteLine(); } } class Program { static void Main() { Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }); Solve(new ReaderWriter()); Console.Out.Flush(); } static void Solve(ReaderWriter rw) { rw.R(); var n = rw.I(); var m = rw.I(); if (m >= n) rw.Write(1); else if (n % 2 != 0) rw.Write(-1); else if (m < n / 2) rw.Write(-1); else rw.Write(2); } }