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