#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, counter;
  counter = 1;
  scanf("%d", &N);
  while (N > 0) {
    N -= counter;
    ++counter;
    if (N == 0)
      printf("YES\n");
    else if (N < 0)
      printf("NO\n");
  }
  return 0;
}
