You are given an integer n and an integer array sources. Positions 0 to n - 1 sit in a row.
On day 0 every position listed in sources is marked. On each later day, every position that is already marked also marks the positions next to it, which are i - 1 and i + 1 when they exist. A position stays marked once it is marked, and every position is marked eventually.
A record lists all n positions, each exactly once. A record is valid when a position marked on an earlier day always comes before a position marked on a later day. Positions marked on the same day may appear in any order relative to each other. The positions in sources are all marked on day 0, so they form one such group as well.
Return the number of distinct valid records. Mod the result by 10 ** 9 + 7.
Input: n = 5, sources = [2]
Output: 4
Explanation: Position 2 is marked on day 0, positions 1 and 3 on day 1, and positions 0 and 4 on day 2. The two day-1 positions can be listed in 2 orders and the two day-2 positions in 2 orders, so there are 4 records.
sources.length ≤nsources[i] ≤n−1sources are distinct, and they are not necessarily sorted