#include using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() #define fi first #define se second typedef vectorvint; typedef pairpint; typedef vectorvpint; templateinline void chmin(A &a,B b){if(a>b)a=b;} templateinline void chmax(A &a,B b){if(a>n; int lb=0,ub=3000000000; while(ub-lb>1){ int mid=(ub+lb)/2; if(mid*(mid+1)/2<=n)lb=mid; else ub=mid; } if(lb*(lb+1)/2==n)cout<<"YES"<