from math import sqrt n = int(input()) n *= 2 i = int(sqrt(n)) for j in range(max(i - 10, 1), i + 11): if j * (j + 1) == n: print("YES") print(j) exit() print("NO")