a,b=map(int,input().split()) n=0 sum=0 if b==0: print('1') exit() elif a*b==-b: print('2') exit() else: print('-1')