//#pragma GCC optimize ("O3") //#pragma GCC target ("avx") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); double n; cin >> n; ll nn=n; ll m=(sqrt(8*n+1)-1)/2; for(ll i=-5;i<=5;i++){ ll p=m+i; if(p%2==0){ if(p/2*(p+1)==nn){ printf("YES\n"); printf("%lld\n",p); return 0; } } else{ if((p+1)/2*p==nn){ printf("YES\n"); printf("%lld\n",p); return 0; } } } printf("NO\n"); }