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