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 mxn = 1e6;
const int mod1 = 1e9 + 7;
const int mod2 = 998244353;
const long long inf = 1e18;
const double pi = 3.1415926535897932384626;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long mpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long inv(long long a, long long m) { return mpow(a, m - 2, m); }
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long ncr(long long n, long long k) {
  if (n < k) return 0;
  long long C[n + 1][k + 1];
  long long i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]);
    }
  }
  return C[n][k];
}
class Solution {
 public:
  void solve() {
    int n;
    cin >> n;
    int s = 0;
    for (int i = 1; s <= n; i++) {
      s += i;
      if (s == n) {
        cout << "YES";
        return;
      }
    }
    cout << "NO";
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  clock_t start, end;
  start = clock();
  Solution ob;
  ob.solve();
  end = clock();
  double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
  cerr << "\nTime : " << fixed << time_taken << setprecision(5) << " s \n";
  return 0;
}
