#include using namespace std; #define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i)) using ll = long long; using P = pair; using namespace std; template void vin(vector& v, int n) { v.resize(n); for (int i = 0; i < n; ++i) { cin >> v[i]; } } // n(n+1)/2 int main() { ll N; cin >> N; long double n = (sqrt(8LL*N+1)-1.0)/2.0; if (!((n - (ll)n) < 1e-18)) { cout << "NO" << endl; } else { cout << "YES" << endl; cout << (ll)n << endl; } return 0; }