n=int(input()) a=1 for i in range(2*10**9+1): if i*(i+1)//2==n: print("YES") print(i) exit() print("NO")