// Arup Guha
// 4/2/2024
// Solution to CSES Problem Coin 2
// https://cses.fi/problemset/task/1636/

/*** This is a space saving DP. Since all the answers we look up for row k of the DP
     table are on row k-1, instead of storing the whole table, we can just store two
	 rows at a time: the previous row and the current row we are computing. I feel this
	 is annoying, but in real run times, you'll see this is roughly twice as fast as
	 using all of the memory the regular DP solution uses.
***/

import java.util.*;

public class coin2alt {

	final public static int MOD = 1000000007;
	
	public static void main(String[] args) {
	
		// Get input sort array.
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		int tot = stdin.nextInt();
		int[] den = new int[n];
		for (int i=0; i<n; i++)
			den[i] = stdin.nextInt();
		Arrays.sort(den);
		
		// dp[i] will store # ways to make change for i cents using den[0] or less.
		int[] dp = new int[tot+1];
		
		// Row 1 - base case.
		for (int i=0; i*den[0]<=tot; i++)
			dp[i*den[0]] = 1;
		
		// Go through each denomination.
		for (int i=1; i<n; i++) {
			
			// next[j] Will store # of ways to make change for j cents using den[i] or less.
			int[] next = new int[tot+1];
			
			// Each amount of money.
			for (int j=0; j<=tot; j++) {
			
				// No coin i, get answer from previous row of dp array.
				if (j < den[i])
					next[j] = dp[j];
					
				// Add in all ways that use coin i at least once.
				else
					next[j] = (dp[j] + next[j-den[i]])%MOD;
			}
			
			// Now the previous row is next.
			dp = next;
		}
		
		// Ta da!
		System.out.println(dp[tot]);		
	}
}