import math n = int(input()) s = int(math.sqrt(8 * n + 1)) if (s ** 2) != (8 * n + 1): print('NO') else: print('YES') print(int((s - 1) / 2))