#include <bits/stdc++.h>
using namespace std;
bitset<10000> trinumb;
void precal() {
  for (int i = 0; i < 40; i++) {
    trinumb[(i * (i + 1)) / 2] = true;
  }
}
int main() {
  precal();
  int n;
  cin >> n;
  if (trinumb[n])
    cout << "YES\n";
  else
    cout << "NO\n";
}
