def main(): a, b = map(int, input().split()) if b == 0: return 1 if a == -1: return 2 return -1 print(main())