print((function (f, a, b) return f(b/a)==b/a and b/a or "NO" end)(math.floor, io.stdin:read("*n"), io.stdin:read("*n")))