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

#QHD0000078. Chia nhóm lập trình viên (Coding Company)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Chia nhóm lập trình viên (Coding Company)

Coding Company

Source: CSES

Version: Phuoc Hung OJ Extended

Problem Statement

A company employs nn distinct coders. Coder ii has skill level tit_i. Partition all coders into nonempty teams so that every coder belongs to exactly one team; the number of teams is unrestricted.

The penalty of a team GG is the difference between its maximum and minimum skill levels, max⁡i∈Gti−min⁡i∈Gti\max_{i\in G}t_i-\min_{i\in G}t_i. A singleton team has penalty 00. The total penalty is the sum over all teams.

Two partitions are different if some pair of coders belongs to the same team in exactly one partition. The order of teams and the order within each team do not matter. Equal skill levels do not make coders indistinguishable.

Count the partitions whose total penalty is at most xx. Print the count modulo 109+710^9+7.

Input

The first line contains integers n,xn,x. The second line contains nn integers t1,t2,…,tnt_1,t_2,\ldots,t_n.

Output

Print one integer: the number of valid partitions modulo 109+710^9+7.

Subtasks

  • Subtask 1 (20 points): 1≤n≤81\le n\le8, 0≤x≤200\le x\le20, 0≤ti≤200\le t_i\le20.

  • Subtask 2 (30 points): 1≤n≤351\le n\le35, 0≤x≤5000\le x\le500, 0≤ti≤1000\le t_i\le100.

  • Subtask 3 (50 points): 1≤n≤1001\le n\le100, 0≤x≤50000\le x\le5000, 0≤ti≤1000\le t_i\le100.

Examples

Example 1

Input

3 2
2 5 3

Output

3

Explanation

The three valid partitions are all singletons, team {2,3}\{2,3\} plus the singleton with skill 55, and team {3,5}\{3,5\} plus the singleton with skill 22.

Example 2

Input

3 0
4 4 4

Output

5

Explanation

All three coders share the same skill, so all five set partitions of three distinct coders have penalty 00.