#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
map<long long, long long> ma, mb;
pair<long long, long long> p[N];
bool b[N];
vector<int> v, v1;
set<long long> s;
int main() {
  long long n;
  cin >> n;
  for (long long int i = 1; i < 100; i++) b[i * (i + 1) / 2] = true;
  if (b[n] == true) {
    return cout << "YES", 0;
  }
  cout << "NO";
  return 0;
}
