#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool yes = false;
  for (int j = 1; j <= n; j++) {
    if ((j * (j + 1)) / 2 == n) {
      yes = true;
      break;
    }
  }
  if (yes)
    cout << "YES";
  else
    cout << "NO";
}
