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