n=int(input()) i=1 N=0 while(N<=n): N+=i if(N==n): print("YES") print(i) break i+=1 else: print("NO")