#include using namespace std; typedef long long ll; int main() { ll n; cin>>n; ll x=sqrt(2*n); if (x*(x+1)/2==n) puts("YES"); else puts("NO"); return 0; }