#include #include int main() { unsigned long long n; std::cin >> n; unsigned long long m = n * 2; m = (int)sqrt(m); if(((m * (m + 1)) / 2) == n) { std::cout << "YES\n" << m << std::endl; } else { std::cout << "NO" << std::endl; } return 0; }