#include using namespace std; int main(){ long long n;cin>>n; long long mn = 0; long long mx = 2000000000; long long ce = (mn+mx)/2; while(mx-mn > 1){ if(ce*(ce+1)/2 > n){ mx = ce; }else if(ce*(ce+1)/2 == n){ cout << "YES" << endl; cout << ce << endl; return 0; }else{ mn = ce; } ce = (mx+mn)/2; } cout << "NO" << endl; }