#include <bits/stdc++.h>
int main() {
  int n = 0, c = 1;
  scanf("%d", &n);
  while ((c * (c + 1)) / 2 <= n) {
    if ((c * (c + 1)) / 2 == n) {
      printf("YES");
      return 0;
    }
    c++;
  }
  printf("NO");
  return 0;
}
