#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
struct io {
  io() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  };
};
const int MOD = 1000000007;
const int INF = INT_MAX;
const long long int LLINF = 1LL << 62;
int main(void) {
  int n, a;
  cin >> n >> a;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  vector<vector<vector<int> > > dp(
      n + 1, vector<vector<int> >(n + 1, vector<int>(5000)));
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      for (int k = 0; k < 2600; k++) dp[i][j][k] = 0;
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 0; k < 5000; k++) {
        if (k - x[i - 1] >= 0) {
          dp[i][j][k] += dp[i - 1][j - 1][k - x[i - 1]];
        }
        dp[i][j - 1][k] += dp[i - 1][j - 1][k];
      }
    }
  }
  long long int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[n][i][a * i];
  }
  cout << (ans) << endl;
}
