#agc049d. [agc049_d]Convex Sequence

[agc049_d]Convex Sequence

Problem Statement

Given are integers NN and MM. Find the number, modulo (109+7)(10^9+7), of length-NN sequences (A1,A2,ldots,AN)(A_1,A_2,\\ldots,A_N) that consist of non-negative integers and satisfy the following conditions:

  • A1+A2+ldots+AN=MA_1+A_2+\\ldots +A_N = M;
  • For every ii (2leqileqN12 \\leq i \\leq N-1), 2AileqAi1+Ai+12 A_i \\leq A_{i-1} + A_{i+1}.

Constraints

  • 1leqNleq1051 \\leq N \\leq 10^5
  • 1leqMleq1051 \\leq M \\leq 10^5
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM

Output

Print the number, modulo (109+7)(10^9+7), of sequences that satisfy the conditions.


Sample Input 1

3 3

Sample Output 1

7

The following seven sequences satisfy the conditions.

  • 0,0,30,0,3
  • 0,1,20,1,2
  • 1,0,21,0,2
  • 1,1,11,1,1
  • 2,0,12,0,1
  • 2,1,02,1,0
  • 3,0,03,0,0

Sample Input 2

10 100

Sample Output 2

10804516

Sample Input 3

10000 100000

Sample Output 3

694681734