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