#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, d, e;
  cin >> n;
  a = 2 * n;
  c = 1 + 4 * a;
  d = sqrt(c);
  if (d * d == c) {
    b = (-1 + d) / 2;
    e = (-1 - d) / 2;
    if (abs((b - abs(e))) == 1)
      cout << "YES";
    else
      cout << "NO";
  }
  if (d * d != c) cout << "NO";
  return 0;
}
