#include using namespace std; using i64 = long long; #define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++) i64 n; int main(){ cin >> n; i64 l = 1; i64 r = (i64)1e9 + 1e5; while(r - l > 1){ i64 m = (l + r) / 2; if((m) * (m + 1) / 2 > n){ r = m; } else{ l = m; } } if(l * (l + 1) / 2 == n){ cout << "YES" << endl << l << endl; } else{ cout << "NO" << endl; } }