import math n = int(input()) t = (math.sqrt(8*n+1)-1)/2 if t == int(t): print("YES") print(int(t)) else: print("NO")