#include using namespace std; #define endl "\n" typedef long long ll; #define int long long int n; void solved() { cin >> n; int l = 1, r = 2e9; while (l < r) { int x = (l + r) >> 1; if ((1 + x) * x / 2 >= n) r = x; else l = x + 1; } if ((1 + l) * l / 2 != n) cout << "NO" << endl; else { cout << "YES" << endl; cout << l << endl; } } signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); /*int t = 1; cin >> t; while (t--)*/ solved(); return 0; }