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