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