Skip to content
UPEEC

Coin Change (Number of Ways)

Medium#dynamic-programming· solved by 0 · time limit 2.0 s

In how many ways can you make xx using unlimited coins of the given distinct values? Order doesn't matter (1+2 and 2+1 are the same). Print modulo 109+710^9+7.

Input

nn, the nn distinct coin values, then xx.

Output

The number of ways modulo 1000000007.

Constraints

1≤n≤1001 \le n \le 100, 0≤x≤1040 \le x \le 10^4

Sample 1

Input

3
1 2 5
5

Output

4

Sample 2

Input

1
2
3

Output

0

Sign in or join free to run and submit your solution.