m;main(long n){scanf("%ld",&n);m=sqrt(2*n);n=m*-~m/2==n;printf(n?"YES\n%d":"NO",m);}