#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
int main() {
  long long int n;
  cin >> n;
  unordered_set<int> s;
  long long int i = 1;
  long long int last = 0;
  for (int ii = 1; ii <= 500; ii++) {
    s.insert(last + i);
    last = last + i;
    i++;
  }
  if (s.find(n) != s.end()) {
    cout << "YES"
         << "\n";
  } else {
    cout << "NO"
         << "\n";
  }
}
