#include <bits/stdc++.h>
using namespace std;
long long n, t, a[51], dp[51][2501];
long long solve(long long i, long long sum, long long m) {
  if (i > n) {
    if (sum == m)
      return 1;
    else
      return 0;
  }
  if (dp[i][sum] != -1) return dp[i][sum];
  long long r1 = 0, r2 = 0;
  if (a[i] + sum <= m) r1 = solve(i + 1, sum + a[i], m);
  r2 = solve(i + 1, sum, m);
  return dp[i][sum] = r1 + r2;
}
int main() {
  long long i, j, k, cumsum = 0, ans = 0;
  scanf("%lld %lld", &n, &t);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    cumsum += a[i];
  }
  for (k = t; k <= cumsum; k += t) {
    for (i = 0; i < 51; i++) {
      for (j = 0; j < 2501; j++) {
        dp[i][j] = -1;
      }
    }
    ans += solve(1, 0, k);
  }
  printf("%lld\n", ans);
  return 0;
}
