#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, j = 0;
  set<int> s;
  cin >> n;
  for (int i = 0; i <= n; i += j) {
    j++;
    s.insert(i);
  }
  if (s.count(n))
    cout << "YES\n";
  else
    cout << "NO\n";
}
