#include #include int main(){ long long int i = 1; long long int n; scanf("%"SCNd64"",&n); while( (i*(i+1))/2 < n ){ i++; } if( (i*(i+1))/2 == n ){ printf("YES\n%lld\n",i); }else{ printf("NO\n"); } return 0; }