import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
static public void main(String[] args) throws IOException {
BjSolution sol = new BjSolution();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
int coinCount = Integer.parseInt(input[0]);
int totalValue = Integer.parseInt(input[1]);
int[] coinValues = new int[coinCount];
for (int i = 0; i < coinCount; i++) {
coinValues[i] = Integer.parseInt(br.readLine());
}
sol.solution(coinCount, totalValue, coinValues);
}
}
class BjSolution {
public void solution(int coinCount, int totalValue, int[] coinValues) {
int[] dp = new int[totalValue + 1];
dp[0] = 1;
for (int coinIdx = 0; coinIdx < coinCount; coinIdx++) {
int curCoin = coinValues[coinIdx];
for (int curValue = curCoin; curValue < totalValue + 1; curValue++) {
dp[curValue] = dp[curValue] + dp[curValue - curCoin];
}
}
System.out.println(dp[totalValue]);
}
}