#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
const long long INF = 1e18 + 7;
long long mod = 1e9 + 7;
long long a[100], dp[100][300][100], n, m;
signed main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i < n + 1; i++) scanf("%lld", &a[i]);
  for (long long i = 0; i < n; i++) dp[i][0][0] = 1;
  for (long long i = 1; i < n + 1; i++) {
    for (long long j = 0; j < 300; j++) {
      for (long long k = 1; k < n + 1; k++) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (j >= a[i]) dp[i][j][k] += dp[i - 1][j - a[i]][k - 1];
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i < 300 + 1; i++) {
    ans += dp[n][i * m][i];
  }
  printf("%lld\n", ans);
  return 0;
}
