#include <bits/stdc++.h>
using namespace std;
const int maxn = 56;
long long n, av, a[maxn], dp[maxn][maxn][maxn];
long long calc(int x, int left, int have, int want) {
  if (x == n) {
    if (have == want && !left)
      return 1;
    else
      return 0;
  }
  if (dp[x][left][have] != -1) return dp[x][left][have];
  int ret = 0;
  ret += calc(x + 1, left, have, want);
  if (left) ret += calc(x + 1, left - 1, have + a[x], want);
  return dp[x][left][have] = ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> av;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    memset(dp, -1, sizeof(dp));
    ans += calc(0, i, 0, av * i);
  }
  cout << ans << '\n';
}
