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