N = int(input()) M = int(N**0.5 - 0.1) + 1 if M * (M + 1) == 2 * N: print('YES') print(M) else: print('NO')