n = int(input()) n *= 2 k = int(n ** 0.5) if k * (k + 1) == n: print('YES') print(k) else: print('NO')