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