#include <bits/stdc++.h>
using namespace std;
int p[101];
int f(int x) {
  if (p[x] != 0) return p[x];
  if (x == 1) return x;
  p[x] = f(x - 1) + x;
  return p[x];
}
int main() {
  int n;
  cin >> n;
  int t = 0;
  while (f(++t) <= n)
    if (f(t) == n) {
      cout << "YES";
      return 0;
    }
  cout << "NO";
  return 0;
}
