#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int val = 1 + (8 * n);
  float sq = sqrt(val);
  if (int(sq) == sq) {
    if (val % 2)
      cout << "YES";
    else
      cout << "NO";
  } else
    cout << "NO";
  return 0;
}
