#include using namespace std; typedef long long LL; typedef vector VI; typedef pair PI; int main() { LL n; cin >> n; bool bo = false; LL a = sqrt(2 * n); if (2 * n == a * (a + 1)) bo = true; if (bo) { cout << "YES" << endl; cout << a << endl; } else { cout << "NO" << endl; } return 0; }