#include using namespace std; int main(){ long long n; cin >> n; int count = 1; while(n>0){ n -= count; count++; } if(n==0){ cout << "YES" << '\n'; cout << count - 1 << '\n'; } else{ cout << "NO" << '\n'; } return 0; }