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 long long OO = 1e8;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
const int N = 100;
bool adjMatrixBool[N][N];
int adjMatrix[N][N];
vector<int> adjMatrixAll[N][N];
map<pair<int, int>, int> adjMatrixMap;
vector<vector<int> > adjList1;
vector<vector<pair<int, int> > > adjList2;
vector<bool> visited;
bool valid(int i, int j) { return 1; }
bool prime(long long n) {
  long long i;
  for (i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b) * b); }
string int_to_str(int num) {
  stringstream ss;
  ss << num;
  return ss.str();
}
char s[120][120];
int main() {
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    if ((i * (i + 1) / 2) == n) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
