def oyasumi(n): p = ((8 * n + 1) ** (0.5) - 1) / 2 p = int(p) for i in range(p, p + 3): if (i ** 2 + i) // 2 == n: return f'YES\n{i}' else: return 'NO' def main(): n = int(input()) print(oyasumi(n)) if __name__ == '__main__': main()