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