#include #include //1...n //S(n)=(n+1)*n/2 long long int n; int main(){ scanf("%lld",&n); //n*n < n*(n+1) <(n+1)*(n+1) for(long long int m = (int)sqrt(2*n) ; m*(m+1) <= 2*n; m++){ if(m*(m+1)==2*n){ puts("YES"); printf("%lld\n",m); return 0; } } puts("NO"); }