from sys import stdin def main(): input = lambda: stdin.readline()[:-1] A, B = map(int, input().split()) if (A > 0 and B > 0) or (not A and B != 0): print(-1) return elif not A and not B: print(1) return if B % A: print(-1) else: ans = abs(B // A) print(max(1, ans)) main()