n, m = map(int, input().split()) ans = m / n if ans.is_integer(): print(int(ans)) else: print("NO")