#include #include using namespace std; int main(){ long long n; cin >> n; long long a = 8*n + 1; long long b = (long long)sqrt(a); if(b*b != a) cout <<"NO" << endl; else{ if((b-1)%2 != 0) cout <<"NO" << endl; else{ cout << "YES" << endl; cout << (b-1)/2 << endl; } } return 0; }