#include "bits/stdc++.h" #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } using namespace std; int main() { fastcin; unsigned long long n; cin >> n; int a = (sqrt(n*8 +1) -1)/2; if((a*a +a -2*n)==0) cout << "YES" << '\n' << a << '\n'; else cout << "NO" << '\n'; return 0; }