import math n=int(input()) m=(math.sqrt(8*n+1)-1)/2 if m==int(m): print("YES\n"+str(int(m))) else: print("NO")