import math n = int(input()) D = 1 + 8 * n s = math.isqrt(D) if s * s == D and s % 2 == 1: k = (s - 1) // 2 print("YES") print(k) else: print("NO")