#include <bits/stdc++.h>
const long double eps = 1e-2;
const long double pi = acos(-1.0);
using namespace std;
const int N = 50;
int n, a;
long long dp[N + 1][N + 1][(N + 1) * (N + 1)], x[N + 1];
void solve() {
  cin >> n >> a;
  for (int i = 1; i <= n; i++) cin >> x[i];
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i - 1; j++) {
      for (int sum = 0; sum <= N * N; sum++) {
        dp[i][j][sum] += dp[i - 1][j][sum];
        if (sum + x[i] <= N * N) dp[i][j + 1][sum + x[i]] += dp[i - 1][j][sum];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[n][i][a * i];
  cout << ans;
}
int main() {
  ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
  cout.setf(ios::fixed), cout.precision(3);
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  int step;
  step = 1;
  for (int i = 1; i <= step; i++) {
    solve();
  }
}
