Problem #288
Stonks
The stocks of a company were valued at N = 123456 on day 0. Every day for the following M = 217127 days, the value either rose by 1 or decreased by 1. Note that the value never remained the same. After M days, the final value was observed to be 172213.
Determine the number of distinct ways in which the stock value could have changed over the M days, such that it never exceeded L = 200000.
Since the number of ways can be huge, print them modulo 10^9+7.