A, B = map(int, raw_input().split()) for x in range(-100,100): if A*x == B: print x exit(0) print("NO")