#include <bits/stdc++.h>
using namespace std;
int a[130000];
int main() {
  int n, m, i, j, k;
  for (i = 1; i <= 500; i++) {
    n = (i * (i + 1)) / 2;
    a[n] = 1;
  }
  scanf("%d", &n);
  if (a[n] == 1)
    printf("YES\n");
  else
    printf("NO\n");
}
