n=int(input()) a=(-1+(1+8*n)**0.5)/2 #print(int(int(a)*int(1+a)/2)) if 0.9999>(a*(1+a)/2)/n: print("YES") print(int(a)) else: print("NO")