#include #include #include int main() { std::string yes = "YES"; std::string no = "NO"; std::string ans = ""; std::int64_t a = 1; std::int64_t n = 0; std::cin >> n; ans = no; std::int64_t i = 2; /*for(i; i < INT_FAST32_MAX;i++) { if (n == a) { ans = yes; break; } a += i; }*/ double k = 0; if (n < std::pow(10, 18)) { double x = sqrt(2 * n * 4 + 1); double y = 0; double x_p = 0; x_p = std::modf(x, &y); if (!(x_p > 0)) ans = yes; k = x / 2 + 1 / 2; } std::cout << ans << std::endl; if (ans == yes) std::cout << std::to_string((std::uint64_t)k); //std::cout << std::to_string(i - 1); return 0; }