#include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,a) for(int i=0;i<(a);i++) #define MOD 1000000007 ll n; bool f(ll x){ return (x*(x+1)/2>=n); } int main(){ cin>>n; ll lb=0, ub=2000000000; while(ub-lb>1){ ll mid=(ub+lb)/2; if(f(mid)) ub=mid; else lb=mid; } if(ub*(ub+1)/2==n) cout<<"YES"<