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