N=int(input()) if int(N**0.5)/2-10000<=0: M=0 else: M=int(N**0.5)/2-10000 for i in range(M,M+20000): if N==(i*(i+1)/2): print("YES") print(i) exit() print("NO")