#include #include #include #include #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define repR(i, n) for(int i = (n) - 1; i > -1; i--) #define rep1(i, n) for(int i = 1; i < (int)(n + 1); i++) #define rep1R(i, n) for(int i = (n); i > 0; i--) #define ll long long using namespace std; ll sum_natural_number(ll s) { return s * (s + 1) / 2; } int main() { ll n; cin >> n; ll years = n / (60 * 60 * 24 * 365); if (years >= pow(10, 10)) { cout << "NO" << endl; return 0; } ll left = 1; ll right = n + 1; while (left < right) { ll mid = left + (right - left) / 2; if (n == sum_natural_number(mid)) { cout << "YES" << endl; cout << mid << endl; return 0; } else if (n < sum_natural_number(mid)) { right = mid; } else { left = mid + 1; } } cout << "NO" << endl; return 0; }