N = int(input()) n = int((N*2)**0.5) if (n+1) * n // 2 == N: print('YES') print(n) else: print('NO')