#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; //----------------------------------------------------------------------- int N; signed main() { cin.tie(0); ios::sync_with_stdio(false); cin>>N; int ok=1e10,ng=0; while(ok-ng>1){ int x=(ok+ng)/2; if(x*(x+1)/2>=N) ok=x; else ng=x; } if(ok*(ok+1)/2==N) cout<<"YES\n"<