x,y = map(int,input().split()) import sys if x == y: print(0) exit() if y == 0: print(1) exit() if x == 0: print(2) exit() print(-1)