import math def main(): N = int(input()) n = int(math.sqrt(N * 2)) if n * (n + 1) // 2 == N: print('YES') print(n) main()