题目描述
Problem Statement
Given are integers N and M.
Find the number, modulo (10^9+7), of $length-N sequences (A_1,A_2,\ldots,A_N)$ that consist of non-negative integers and satisfy the following conditions:
- $A_1+A_2+\ldots +A_N = M$;
- For every $i (2 \leq i \leq N-1), 2 A_i \leq A_{i-1} + A_{i+1}$.
Input
Input is given from Standard Input in the following format:
N M
Output
Print the number, modulo (10^9+7), of sequences that satisfy the conditions.
Constraints
- $1 \leq N \leq 10^5$
- $1 \leq M \leq 10^5$
- All values in input are integers.
Sample Input 1
3 3
Sample Output 1
7
The following seven sequences satisfy the conditions.
- 0,0,3
- 0,1,2
- 1,0,2
- 1,1,1
- 2,0,1
- 2,1,0
- 3,0,0
Sample Input 2
10 100
Sample Output 2
10804516
Sample Input 3
10000 100000
Sample Output 3
694681734
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分
样例输入
3 3
样例输出
7