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