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