A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a triangle with n dots on a side. <image>. You can learn more about these numbers from Wikipedia (http://en.wikipedia.org/wiki/Triangular_number).

Your task is to find out if a given integer is a triangular number.

Input

The first line contains the single number n (1 ≤ n ≤ 500) — the given integer.

Output

If the given integer is a triangular number output YES, otherwise output NO.

Examples

Input

1


Output

YES


Input

2


Output

NO


Input

3


Output

YES
#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1E9;
const long long LINF = (long long)4E18;
const long double PI = acos(-1.0);
const long double EPS = 1E-7;
template <typename T>
T gcd(T a, T b) {
  return (b == 0) ? abs(a) : gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline T mod(T a, T b) {
  a %= b;
  if (a < 0) a += b;
  return a;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline T gmax(T a, T b) {
  return (a > b ? a : b);
}
template <typename T>
inline T gmin(T a, T b) {
  return (a < b ? a : b);
}
template <typename T>
inline string toString(T x) {
  ostringstream oss;
  oss << x;
  return oss.str();
}
inline long long toInt(const string& st) {
  istringstream iss(st);
  long long x;
  iss >> x;
  return x;
}
inline long double toDouble(const string& st) {
  istringstream iss(st);
  long double x;
  iss >> x;
  return x;
}
inline string toLower(string st) {
  for (int i = 0; i < (((int)(st).size())); i++) st[i] = tolower(st[i]);
  return st;
}
inline string toUpper(string st) {
  for (int i = 0; i < (((int)(st).size())); i++) st[i] = toupper(st[i]);
  return st;
}
bool LOCAL = false, OUTPUT = true;
const char DEBUG_PARAM[] = "__LOCAL_TESTING";
const char IN[] = "_.in";
const char OUT[] = "_.out";
inline void init();
inline void run();
int ntest = 0, test;
int main(int argc, char* argv[]) {
  if (argc > 1 && strcmp(argv[1], DEBUG_PARAM) == 0) {
    LOCAL = true;
    freopen(IN, "r", stdin);
  }
  init();
  if (ntest == 0) {
    cerr << "ntest = ?" << endl;
    return 0;
  }
  for (test = 1; test <= ntest; ++test) {
    run();
  }
  return 0;
}
inline void stop() { ntest = test - 1; }
const int dx[] = {-1, 0, 0, 1};
const int dy[] = {0, -1, 1, 0};
inline void init() {
  OUTPUT = true;
  ntest = 1;
}
inline void run() {
  int n;
  cin >> n;
  for (int i = (1); i <= (n); i++)
    if (i * (i + 1) == n * 2) {
      cout << "YES";
      return;
    }
  cout << "NO";
}
