#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, i = 1;
  cin >> n;
  if (n < 0)
    cout << "NO\n";
  else {
    while (1) {
      if (sum == n) {
        cout << "YES\n";
        break;
      } else if (sum > n) {
        cout << "NO\n";
        break;
      }
      sum = sum + i;
      i++;
    }
  }
}
