#include <bits/stdc++.h>
using namespace std;
long long j, k, a[11111], b, s, ss, l, m, n, t, d;
long long e, i, c[221];
string p[5] = {"S", "M", "L", "XL", "XXL"}, q[111], r, v;
char w;
map<string, long long> y, z;
int main() {
  cin >> n;
  k = sqrt(2 * n);
  if (n == k * (k + 1) / 2)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
