#include #include #include #define rep(i, a, n) for(int i = a;i < n;i++) #define repe(i, a, n) for(int i = a;i <= n;i++) #define repr(i, a, n) for(int i = a;i > n;i--) using namespace std; using llint = long long int; int n; llint solve(){ n *= 2; llint i = (llint)sqrt(n)-1; while(i++){ llint v = i*i + i - n; if(!v) return i; else if(v > 0) return 0; } return 0; } int main(){ cin >> n; llint j = solve(); if(j) cout << "YES" << endl, cout << j << endl; else cout << "NO" << endl; return 0; }