#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 0, n;
  bool ok(false);
  cin >> n;
  while (i * (i + 1) / 2 <= n && ok == false) {
    if (i * (i + 1) / 2 == n) {
      ok = true;
    }
    i++;
  }
  (ok == true) ? cout << "YES" : cout << "NO";
  return 0;
}
