PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#QHD0000045. Tổ hợp tiền xu I (Coin Combinations I)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Tổ hợp tiền xu I (Coin Combinations I)

Coin Combinations I

Source: CSES

Version: Phuoc Hung OJ Extended

Problem Statement

A currency system provides nn distinct positive denominations c1,…,cnc_1,\ldots,c_n. You have an unlimited supply of each denomination. Count the number of ordered coin sequences with total exactly xx: sequences with different orders are considered different. Print the result modulo 109+710^9+7.

Input

The first line contains nn and xx, followed by nn distinct denominations cic_i.

Output

Print the number of ordered sequences modulo 109+710^9+7.

Subtasks

The independent scoring groups have the following complete constraints:

  • Subtask 1 (20%): 1≤n≤41\le n\le4, 1≤x≤251\le x\le25, 1≤ci≤251\le c_i\le25, all cic_i distinct.
  • Subtask 2 (30%): 1≤n≤201\le n\le20, 1≤x≤10001\le x\le1000, 1≤ci≤10001\le c_i\le1000, all cic_i distinct.
  • Subtask 3 (50%): 1≤n≤1001\le n\le100, 1≤x≤10000001\le x\le1000000, 1≤ci≤10000001\le c_i\le1000000, all cic_i distinct.

Examples

Input

3 9
2 3 5

Output

8

Explanation

There are 88 ordered sequences summing to 99: 2,2,52,2,5 gives 33 permutations; 2,2,2,32,2,2,3 gives 44; and 3,3,33,3,3 gives 11. Thus 3+4+1=83+4+1=8.