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