#include int main () { long long n; std::cin >> n; long long i = 1L, s = 0L; bool result = false; while (true) { s += i; if (s == n) { result = true; break; } else if (s > n) { break; } ++i; } std::cout << (result ? "YES" : "NO") << std::endl; if (result) std::cout << i << std::endl; }