Link to this code: https://cses.fi/paste/cec6c5a946bc58f61f10d4/
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class CoinCombination {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
//long n;

		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int x = in.nextInt();
		int coins[] = new int[n];
		//int start_ind = 0;
		for (int i = 0; i < n; i++) {
			coins[i] = in.nextInt();
		}
		 Arrays.sort(coins);
		int dp[] = new int[x + 1];

		int mod = 1000000007;
		dp[0] = 1;

		for (int i = coins[0]; i < dp.length; i++) {
			dp[i] = 0;
			for (int j = 0; j < n; j++) {
				 if ( coins[j]>i)
				 break;
				
					dp[i] = (dp[i] + dp[i - coins[j]]) % mod;

				
			}
		}
		

		System.out.println(dp[dp.length - 1]);
	}
}