#include using namespace std; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); long long n; cin >> n; long long ng = 0, ok = n; while((ok - ng) > 1){ long long mid, t; mid = (ok + ng) / 2; t = mid * (1 + mid) / 2; if(t < n) ng = mid; else ok = mid; } if(ok * (1 + ok) / 2 == n) { cout << "YES" << endl; cout << ok << endl; }else{ cout << "NO" << endl; } return 0; }