def isqrt(n): if n<=0: return 0 if n<4: return 1 x,y=0,n while x!=y and x+1!=y: x,y=y,(n//y+y)//2 return x n=8*int(raw_input())+1 q=isqrt(n) print('NO' if q*q!=n else 'YES\n'%(q//2))