import math n = int(input()) a = round(math.sqrt(1+8*n)) print("YES\n%d" %(a//2) if a==(math.sqrt(1+8*n)) else "NO")