#include <bits/stdc++.h>
using namespace std;
const long long N = 3009;
long long n, second, a[N], dp[N][N];
long long first(long long i, long long x) {
  if (x and i == n) return 0;
  if (x < 0) return 0;
  if (x == 0) return 1 + n - i;
  if (dp[i][x] != -1) return dp[i][x];
  long long res = first(i + 1, x - a[i]);
  if (x == second) res *= (i + 1);
  res += first(i + 1, x);
  return dp[i][x] = res;
}
int32_t main() {
  if (fopen("input.txt", "r"))
    freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  ios::sync_with_stdio(0), cin.tie(0);
  memset(dp, -1, sizeof dp);
  cin >> n >> second;
  for (long long i = 0; i < n; i++) cin >> a[i];
  cout << first(0, second);
}
