#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int temp = 1;
  int i = 0;
  while (i < n) {
    i = temp + i;
    temp = temp + 1;
    if (i == n) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
