A,B=map(int,input().split()) n=1 if B==0 else 2 if A==-1 else -1 print(n)