#include using namespace std; const long long INF = 3000000000; int main(){ long long n; cin >> n; long long tv = INF; long long fv = 0; while (tv - fv > 1){ long long mid = (tv + fv) / 2; if (mid * (mid + 1) / 2 >= n){ tv = mid; } else { fv = mid; } } if (tv * (tv + 1) / 2 == n){ cout << "YES" << endl; cout << tv << endl; } else { cout << "NO" << endl; } }