#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  double t = (-1 + sqrt(1 + 8 * n)) / 2;
  if (abs(t - int(t)) < 1e-9)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
