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