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