// Arup Guha
// 4/2/2024
// Solution to most cases of CSES Problem Coin 2
// https://cses.fi/problemset/task/1636/

/*** Note: This solution TLEs on some cases, but I believe it's better than my solution
           that passes for teaching purposes. This one's slower because it allocates the
		   memory for the whole table, but I believe it's easier to teach DP this way.
		   My solution that passes is a space saving optimization of this one, but this
		   is what you get when you classically solve the problem at hand.
***/

import java.util.*;

public class coin2 {

	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][j] will store # ways to make change for j cents using den[i] or less.
		int[][] dp = new int[n][tot+1];
		
		// Row 1 - base case.
		for (int i=0; i*den[0]<=tot; i++)
			dp[0][i*den[0]] = 1;
		
		// Go through each denomination.
		for (int i=1; i<n; i++) {
		
			// Each amount of money.
			for (int j=0; j<=tot; j++) {
			
				// Add in all the ways to make change for j cents without coin i.
				dp[i][j] += dp[i-1][j];
				
				// Add in all ways that use coin i at least once.
				if (j >= den[i]) dp[i][j] = (dp[i][j] + dp[i][j-den[i]])%MOD;
			}
		}
		
		// Ta da!
		System.out.println(dp[n-1][tot]);	
	}
}