a,b = map(int,input().split(" ")) if b ==0: print(1) elif a==-1: print(2) else: print(-1)