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