#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  float x, y;
  cin >> n;
  x = (sqrt(8 * n + 1) - 1) / 2;
  y = x - (int)x;
  if (y == 0)
    cout << "YES";
  else
    cout << "NO";
}
