#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; int main(){ cin.tie(0); ios::sync_with_stdio(false); ull n; cin >> n; ull t = 8 * n + 1; ull s = sqrt(t); bool ok = false; for(int i = -1; i <= 1; i++){ if((s + i) * (s + i) == t){ s = s + i; ok = true; break; } } if(!ok || (s - 1) % 2 != 0){ cout << "NO" << endl; }else{ cout << "YES" << endl; cout << (s - 1) / 2 << endl; } }