N=int(input()) n=int((N*2)**0.5) if(N==(n+1)*n//2): print("YES") print(n) else: print("NO")