def main(): N = int(input()) left = 0 right = 10 ** 10 mid = right // 2 while 1: x = (mid * (mid + 1)) // 2 if x == N: print('YES') print(mid) break elif right - left == 1: print('NO') break if x > N: right = mid else: left = mid mid = (left + right) // 2 main()