#include <bits/stdc++.h>
using namespace std;
long long i, j, n, a, b, c, d, l, ll, r, s, t, k, m, xh, x, x1, y, z;
string p, q;
int main() {
  cin >> t;
  n = sqrt(2 * t);
  if (t == n * (n + 1) / 2)
    cout << "YES";
  else
    cout << "NO";
}
