main(long double n){scanf("%Lf",&n);long q=n=sqrtl(8*n+1);printf(q<n?"NO":"YES\n%d",q/2);}