#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int t = n * 2;
  int f = floor(sqrt(t));
  if (f * (f + 1) == t) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
