import math n = int(input()) a, b = math.floor(math.sqrt(2*n)), math.floor(math.sqrt(2*n))+1 if a*b == 2*n: print("YES") print(a) else: print("NO")