#include <bits/stdc++.h>
using namespace std;
int main() {
  string k, p;
  long long a, b, c[100000], d = 0, e = 0, f = 0, g, h, i, j, l, m, n, o, q, r,
                             s, t, u, v, w, x, y, z;
  cin >> a;
  b = sqrt(2 * a);
  for (i = 1; i <= b; i++) {
    d = d + i;
  }
  if (a == d) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
