#include #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; using lint=long long; int main(){ lint n; scanf("%lld",&n); lint lo=1,hi=2e9; while(hi-lo>1){ lint mi=(lo+hi)/2; if(mi*(mi+1)/2<=n) lo=mi; else hi=mi; } if(lo*(lo+1)/2==n) printf("YES\n%lld\n",lo); else puts("NO"); return 0; }