A, B = map(int, input().split())

if B == 0:
    print(1)
elif A * B + B == 0:
    print(2)
else:
    print(-1)