#define _GLIBCXX_DEBUG #define ll long long #include using namespace std; using Graph = vector>; int main(){ ll M; cin >> M; ll bot = 0, top = 2e9; while(bot+1 < top){ ll mid = (bot+top)/2; ll sum = mid*(mid+1)/2; if(sum == M){ cout << "YES" << endl << mid << endl; return 0; } if(M < sum) top = mid; else bot = mid; } cout << "NO" << endl; }