a,b=map(int,input().split()) if b==0: print(1) exit() if b!=0 and a==-1: print(2) exit() print(-1)