#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
int n, a, x[51], dp[51][3000][51];
int solve(int i, int sum, int t) {
  if (i == n) {
    if (t == 0) return 0;
    if (sum == a * t) return 1;
    return 0;
  }
  if (dp[i][sum][t] != -1) return dp[i][sum][t];
  return dp[i][sum][t] = solve(i + 1, sum, t) + solve(i + 1, sum + x[i], t + 1);
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) cin >> x[i];
  memset(dp, -1, sizeof dp);
  cout << solve(0, 0, 0);
  return 0;
}
