A, B = map(int, input().split()) S = 0 if B == 0: S = 1 else: if A == -1: S = 2 else: S = -1 print(S)