n = int(input()) t, k = 0, 0 while k < n: k = t * (t + 1) // 2 t += 1 if t >= 100000: print("NO") else: print("YES") print(t - 1)