#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; int main() { ll n; cin >> n; ll s = (sqrt(8uLL * n + 1) - 1) / 2; for (ll i = s - 1; i < s + 2; ++i) { if (n == (i * (i + 1)) / 2) { cout << "YES" << endl; cout << i << endl; return 0; } } cout << "NO" << endl; return 0; }