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;
long long power(long long a, long long b, long long m = 1000000007) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res % m;
}
long long inverse(long long a, long long m = 1000000007) {
  return power(a, m - 2, m);
}
bool func(long long n) {
  vector<long long> v;
  long long check;
  for (int i = 1; i <= 500; i++) {
    check = (i * (i + 1)) / 2;
    v.push_back(check);
  }
  vector<long long>::iterator it;
  it = find(v.begin(), v.end(), n);
  if (it != v.end()) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  bool ans = func(n);
  if (ans == true)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
  return 0;
}
