import math from math import sqrt import sys from collections import deque, defaultdict from heapq import heappop, heappush from copy import deepcopy INF=10**18 MOD=10**9+7 MAX=10**5+7 #N,K=map(int, input().split()) #A=list(map(int, input().split())) def main(): A,B=map(int, input().split()) if B==0: print(1) elif A==-1: print(2) else: print(-1) if __name__ == '__main__': main()