#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, i, j, c = 0;
  cin >> n;
  i = 1;
  while (n > 0) {
    n -= i;
    i++;
  }
  if (n == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
