n, m = map(int, input().split()) if (n, m) != (2, 1): print(1 if n <= m else -1) else: print(2)