def main(): X, Y = map(int, input().split()) if X == Y: print(0) return if not Y: print(1) elif not X: print(2) else: print(-1) main()