s = list(map(int, input().split())) if s[1] == 0: print(1) elif s[0] == -1: print(2) else: print(-1)