#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { unsigned long long N; cin >> N; unsigned long long a = floor(sqrt(8*N+1)); if ( a*a == 8*N+1 ) { cout << "YES" << endl; cout << (a-1)/2 << endl; } else { cout << "NO" << endl; } return 0; }