I am given $m$ ordered "free spaces" and $k$ disjoint sets $\mathcal{S} = \{S_1, \ldots, S_k\}$, where the $S_i$ contains $n_i > 0$ elements.
In how may ways can I fill up the free spaces with elements from sets in $\mathcal{S}$, s.t. for each $S_i$ between 1 and $n_i$ elements are picked, and that all elements from $S_i$ are added to the free spaces after the elements of $S_{i-1}$ and before $S_{i+1}$?
I see some connection to stirling numbers of second kind, but the upper bound of $n_i$ make the problem more difficult. Also the stirling number counts the number of ways to partition the set into non empty unlabeled subsets, but since we have the constraint that lements from $S_i$ are added to the free spaces after the elements of $S_{i-1}$ and before $S_{i+1}$ we have labeled subsets.