#c221101. 不定方程的解

不定方程的解

Solutions of a Diophantine Equation

Problem Description

Given the indeterminate equation ∑i=1nxi=m\sum_{i=1}^n x_i = m and nn constraints xi≤bix_i \leq b_i, where m,bi∈Nm, b_i \in \mathbb{N}. Find the number of non-negative integer solutions to the equation.

Since the answer can be very large, output the result modulo 109+710^9 + 7.

Input Format

The first line contains two integers n,mn, m (1≤n≤10,1≤m≤1091\leq n\leq 10, 1\leq m \leq 10^9), followed by one line with nn integers b1,b2,…,bnb_1, b_2, \dots, b_n (1≤bi≤m1\leq b_i\leq m).

Output Format

One number, the answer.

Sample Input

3 5
2 3 4

Sample Output

11

Constraints

For 100%100\% of the data, 1≤n≤10,1≤m≤109,1≤bi≤m1\leq n\leq 10, 1\leq m \leq 10^9, 1\leq b_i\leq m.