#include <bits/stdc++.h>
using namespace std;
map<int, int> d;
int n;
void solve() {
  if (d[n] == 1)
    printf("YES\n");
  else
    printf("NO\n");
}
int main() {
  int i, tong;
  tong = 0;
  for (i = 0; tong <= 5000; i++) {
    tong += i;
    d[tong] = 1;
  }
  while (scanf("%d", &n) > 0) {
    solve();
  }
  return 0;
}
