import sys N = int(input()) add = 1 sum = 0 while sum < N: sum += add if sum == N: print("YES") print(add) sys.exit() add += 1 print("NO")