#include #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) (v).begin(),(v).end() #define int long long #define INF 1e18 #define MOD 1000000007 #define SIZE 100005 using namespace std; typedef pair P; //----------------------------------------------------------------------- signed main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin>>n; int D=1+8*n; int k=(int)sqrt(D); if(k*k==D && k&1){ cout<<"YES"<