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