#goodnight A = range(1,1000000) A = [int(1/2*x*(x-1)) for x in A] goodnight = int(input()) print(goodnight in A) if (goodnight in A ): print("YES") print(A.index(goodnight)) else: print("NO")