import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines """ ・全員の団体行動 ・ちょうど半分 """ N,M = map(int,read().split()) if N <= M: answer = 1 elif N//M == 2: answer = 2 else: answer = -1 print(answer)