#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  for (int i = 1; i <= n; ++i)
    if (i * i + i == 2 * n) {
      std::cout << "YES" << std::endl;
      return 0;
    }
  std::cout << "NO" << std::endl;
}
