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