# include # include # include # include # include # include # include # include # include # include # include # include # include # include # include #include #include #include #include #include using namespace std; typedef long long int ll; const int N = 1000000; const ll INF = std::numeric_limits::max(); #define rep(i,n) for(ll i=(ll)0;i<(ll)n;++i) #define ALL(x) x.begin(),x.end() #define pp pair #define fi first #define se second #define sz size const ll mod = 1000000007; string YN(bool b) { return(b ? "YES" : "NO"); } string yn(bool b) { return(b ? "Yes" : "No"); } ll n,m=0,ct=1; int main() { cin >> n; while (n > m) { m += ct; ++ct; } if (n == m)cout << "YES" << "\n" << ct-1 << endl; else cout << "NO" << endl; return 0; }