AT_arc215_d [ARC215D] cresc.
Description
For a sequence $ A = (A_1, A_2, \ldots, A_{N+1}) $ of length $ N+1 $ , consider obtaining a sequence $ S = (S_1, S_2, \ldots, S_N) $ of length $ N $ in the following way.
- For each $ i $ ( $ 1 \le i \le N $ ), let $ S_i = A_i + A_{i+1} $ .
Find the number, modulo $ 10^9 + 7 $ , of sequences $ S $ of length $ N $ satisfying all of the following conditions.
- $ S $ is non-decreasing.
- There exists a sequence $ A $ of length $ N+1 $ consisting of integers between $ 0 $ and $ M $ , inclusive, such that $ S $ can be obtained from $ A $ in the way described above.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ M $
Output Format
Output the answer on a single line.
Explanation/Hint
### Sample Explanation 1
The possible sequences $ A $ are the following eight:
- $ A = (0,0,0) $ , for which $ S = (0,0) $
- $ A = (0,0,1) $ , for which $ S = (0,1) $
- $ A = (0,1,0) $ , for which $ S = (1,1) $
- $ A = (0,1,1) $ , for which $ S = (1,2) $
- $ A = (1,0,0) $ , for which $ S = (1,0) $
- $ A = (1,0,1) $ , for which $ S = (1,1) $
- $ A = (1,1,0) $ , for which $ S = (2,1) $
- $ A = (1,1,1) $ , for which $ S = (2,2) $
Among these, we have five distinct non-decreasing $ S $ : $ (0,0),(0,1),(1,1),(1,2),(2,2) $ .
### Constraints
- $ 1 \le N, M \le 10^7 $
- All input values are integers.