n=int(input())
ok=0
ng=10**10
while ng-ok>1:
	m=(ok+ng)//2
	if n>=m*(m+1)//2:
		ok=m
	else:
		ng=m
print("YNEOS"[ok*(ok+1)//2!=n::2])