#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[500], sum = 0, r = 0;
  int n;
  int ok;
  cin >> n;
  for (int i = 0; i < 500; i++) {
    a[i] = sum + i;
    sum = a[i];
  }
  for (int i = 0; i <= 31; i++)
    if (a[i] == n) {
      cout << "YES";
      exit(0);
    }
  cout << "NO";
}
