#include using namespace std; #define rep(i, m, n) for (int i = m; i < n; ++i) #define rem(i, m, n) for (int i = m; i >= n; --i) typedef long long ll; int main(){ ll N; cin >> N; ll l = 0; ll r = 2e9; ll mid; rep(i, 0, 100) { mid = (l + r) / 2; ll sum = mid * (mid + 1) / 2; if(sum >= N) r = mid; else l = mid; } if(r * (r + 1) / 2 == N) { cout << "YES" << endl; cout << r << endl; } else cout << "NO" << endl; return 0; }