#include int main () { unsigned long long n; std::cin >> n; unsigned long long total = 0; unsigned long long lb = 1, ub = 2e18, mid; unsigned long long ans = 0; while (lb + 1 < ub) { mid = (lb + ub) >> 1; total = mid * (mid + 1) >> 1; if (total == n) { ans = mid; break; } else if (total > n) { ub = mid; } else { lb = mid; } } std::cout << (ans ? "YES" : "NO") << std::endl; if (ans) std::cout << ans << std::endl; }