#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define llong long long int main() { llong n; cin >> n; int i = (int)sqrt(n*2); if(n == 1) { cout << "YES\n"; cout << n << "\n"; } else if((llong)i*(i+1) / 2 == n) { cout << "YES\n"; cout << i << "\n"; } else if((llong)(i+1)*(i+2) / 2 == n) { cout << "YES\n"; cout << i+1 << "\n"; } else { cout << "NO\n"; } }