import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class BOJ_G5_2293_동전1 {
static BufferedReader br;
static StringTokenizer st;
static int n, k;
static int[] coins, dp;
public static void main(String[] args) throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
st = new StringTokenizer(br.readLine());
n = Integer.parseInt(st.nextToken());
k = Integer.parseInt(st.nextToken());
coins = new int[n + 1];
dp = new int[k + 1];
for(int i = 1; i <= n; i++) {
coins[i] = Integer.parseInt(br.readLine());
}
dp[0] = 1;
for(int i = 1; i <= n; i++) {
for(int j = coins[i]; j <= k; j++) {
dp[j] = dp[j] + dp[j - coins[i]];
}
}
System.out.println(dp[k]);
}
}