#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, p = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') p = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return x * p;
}
inline void File() {
  freopen("C.in", "r", stdin);
  freopen("C.out", "w", stdout);
}
const int N = 50 + 2;
int n, s, a[N], dp[N][N][N * N], mx;
int main() {
  n = read(), s = read();
  for (int i = 1; i <= n; ++i) mx += a[i] = read();
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j <= i; ++j)
      for (int k = 0; k <= mx; ++k) {
        if (j && k >= a[i]) dp[i][j][k] += dp[i - 1][j - 1][k - a[i]];
        dp[i][j][k] += dp[i - 1][j][k];
      }
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans += dp[n][i][i * s];
  cout << ans << endl;
  return 0;
}
