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

#QHD0000046. Tổ hợp tiền xu II (Coin Combinations II)

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 II (Coin Combinations II)

Coin Combinations II

Source: CSES

Version: Phuoc Hung OJ Extended

Problem Statement

A currency system has nn distinct positive denominations, with an unlimited supply of each type. Count the number of ways to choose how many coins of each denomination sum to exactly xx. Order does not matter: a choice is determined solely by its counts for each denomination. Report the result modulo 109+710^9+7.

Input

The first line contains nn and xx. The next line contains the nn distinct denominations cic_i.

Output

Print the number of combinations 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

3

Explanation

There are exactly 33 multisets of coins: 2+2+52+2+5, 3+3+33+3+3 and 2+2+2+32+2+2+3. Reordering coins does not create another way.