n = int(input()) count = 0 i = 1 if n < 2 * 10**18: while True: count += i if count == n: print('YES') print(i) break else: i += 1 else: print('NO')