#include #include #include #include #include #include #include #include #include using namespace std; long long calc(long long x) { return x * (x + 1) / 2; } int main() { long long n; cin >> n; long long a = 1; long long b = 2000000000LL; long long result = -1; while (a <= b) { long long c = (a + b) / 2; long long x = calc(c); if (x == n) { result = c; break; } else if (x < n) { a = c + 1; } else { b = c - 1; } } if (result != -1) { cout << "YES" << "\n"; cout << result << "\n"; } else { cout << "NO" << "\n"; } return 0; }