#include using namespace std; typedef long long ll; const int MOD = 1000000007; const ll INF = 10000000000; #define REP(i,n) for((i)=0;(i)<(int)(n);(i)++) ll n; bool C(ll k){ double sum = k * (k + 1) / 2; return sum >= n; } int main(){ cin >> n; ll ng = 0; ll ok = INF; while(abs(ok - ng) > 1){ ll mid = (ok + ng) / 2; if (C(mid)) ok = mid; else ng = mid; } if (ok == n) cout << "YES" << endl; else cout << "NO" << endl; return 0; }