#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
using vP = vector<P>;
using vPP = vector<vP>;
using vPl = vector<Pl>;
const int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 62) - 1;
ll ceil(const ll& a, const ll& b) { return ((a) + (b)-1) / b; }
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n, a;
  cin >> n >> a;
  vi x(n);
  for (ll i = 0; i < n; i++) cin >> x[i];
  vector<vii> dp(n + 1, vii(n + 1, vi(2550)));
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      for (ll k = 0; k < 2510; k++) {
        if (x[i - 1] <= k && j > 0)
          dp[i][j][k] += dp[i - 1][j - 1][k - x[i - 1]];
        dp[i][j][k] += dp[i - 1][j][k];
      }
    }
  }
  ll ans = 0;
  for (int j = 1; j <= n; j++) {
    ans += (ll)dp[n][j][a * j];
  }
  cout << ans << '\n';
}
