#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5;
vector<int> v;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, sum = 0, arr[N];
  cin >> n;
  for (int i = 1; i <= (n); i++)
    if (i * (i + 1) / 2 == n) {
      cout << "YES" << endl;
      return 0;
    }
  cout << "NO" << endl;
}
