#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  long long triangular = 1;
  long long i = 1;
  while (triangular < n) {
    i += 1;
    triangular += i;
  }
  if (triangular == n) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
