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