import sys if sys.platform =='ios': import clipboard a=clipboard.get() a = a.split('\n') text = '\n'.join(a) with open('input_file.txt','w') as f: f.write(text) sys.stdin = open('input_file.txt') n = int(input()) if n >= 10**18: exit(print("NO")) ans = 0 for i in range(int((n)**0.5),n//2): ans = i*(i+1)//2 if ans == n: exit(print("YES",i,sep="\n"))