#include #include #include #include int main(void) { uint64_t n; scanf("%" PRIu64, &n); uint64_t k = sqrtl(2 * n); if (k * (k + 1) / 2 == n) { printf("YES\n%" PRIu64 "\n", k); } else { printf("NO\n"); } return 0; }