#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rep(i,m,n) for(int i = m;i < n;++i) #define pb push_back #define rrep(i,m,n) for(int i = m;i >= n;--i) #define INF INT_MAX-1; using namespace std; using ll = long long; using R = double; const ll inf = 1LL << 50; const ll MOD = 1e9 + 7; struct edge { ll from; ll to; ll cost; }; int main(){ ll n; cin >> n; ll ng = 0; ll ok = 3e9; while (ng+1 != ok) { ll mid =(ng+ok)/2; if (mid*(mid+1)/2 >= n)ok = mid; else ng = mid; } if (ok*(ok+1)/2==n) { cout << "YES" << endl; cout << ok << endl; } else { cout << "NO" << endl; } return 0; }