#include <bits/stdc++.h>
using namespace std;
long long C(long long L, long long R) {
  int c = 1;
  for (int i = 0; i < R; i++) {
    c *= L - i;
  }
  for (int i = R; i > 1; i--) {
    c /= i;
  }
  return c;
}
int n, a, x[101];
long long dp[10101][101] = {0};
long long dfs(int num, int i) {
  if (i == n) {
    if (num == 5000) return 1;
    return 0;
  }
  if (dp[num][i] != 0) return dp[num][i];
  dp[num][i] += dfs(num + x[i], i + 1) + dfs(num, i + 1);
  return dp[num][i];
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    x[i] -= a;
  }
  cout << dfs(5000, 0) - 1 << endl;
  return 0;
}
