#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  set<int> esta;
  for (int i = 0; i * (i + 1) / 2 + 2 <= 500; i++) {
    esta.insert(i * (i + 1) / 2);
  }
  int n;
  cin >> n;
  if (esta.count(n) != 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
