#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int flag = 0;
    for (int i = 1; i <= 10005; i++) {
      int ans = i * (i + 1) / 2;
      if (ans == n) {
        flag = 1;
      }
    }
    if (flag) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
