// Arup Guha
// 4/6/2024
// Solution to CSES Problem: Coin Combinations I
// https://cses.fi/problemset/task/1635

import java.util.*;

public class coin1 {

	final public static int MOD = 1000000007;
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		int val = stdin.nextInt();
		
		// Read in all coins.
		int[] coins = new int[n];
		for (int i=0; i<n; i++)
			coins[i] = stdin.nextInt();
		
		// I can make change for 0 cents in 1 way.
		int[] dp = new int[val+1];
		dp[0] = 1;
		
		// Making change for i cents.
		for (int i=1; i<=val; i++) {
			
			// Go through all coins.
			for (int x: coins) {
			
				// coin x is too big.
				if (x > i) continue;
		
				// Here we add in giving coin x first.
				dp[i] = (dp[i] + dp[i-x])%MOD;
			}
		}
		
		// Ta da!
		System.out.println(dp[val]);
	}
}