#include #include using namespace std; using LL = long long; using ULL = unsigned long long; int main() { ULL n; cin >> n; ULL i = sqrt(n * 2); if (n * (n + 1) / 2 == n) { cout << "YES" << endl; } else { cout << "NO" << endl; } }