# All possible heaps

Computer Science Level 4

How many distinct (not necessarily binary) min-heaps can be constructed from the nodes with keys $$1,\ldots,999999$$?

Give the answer modulo $$10^{9}+7$$.

Note:

Let be $$H_1, H_2$$ two heaps: $$H_1 \neq H_2 \iff \exists uv \; \; \textbf{:} \; \; uv \in H_1 \land uv \notin H_2$$

×