#include <bits/stdc++.h>
using namespace std;
int main() {
  int Tn;
  cin >> Tn;
  for (int n = 1; n <= Tn; n++) {
    if (n * (n + 1) / 2 == Tn) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
}
