import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class boj2293 {
static int N, K;
static int D[] = new int [100001];
public static void main(String[] args) throws IOException {
int A[];
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
N = Integer.valueOf(st.nextToken());
K = Integer.valueOf(st.nextToken());
A = new int[N];
for (int i = 0; i < N; i++) {
A[i] = Integer.valueOf(br.readLine());
}
check(N,K,A);
System.out.println(D[K]);
}
private static void check(int n, int k, int[] a) {
D[0]=1;
for (int i = 0; i < n; i++) {
for (int j = a[i]; j <= k; j++) {
D[j]+=D[j-a[i]];
}
}
}
}