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