#include <bits/stdc++.h>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
priority_queue<int> pq;
static const int NIL = -1;
static const int INF = 1000000007;
deque<int> deq;
const ll MOD = (1e+9) + 7;
ll dp[51][51][2505];
int main() {
  ll n, a;
  cin >> n >> a;
  vector<ll> x(n, 0);
  for (int i = 1; i <= (int)(n); i++) {
    cin >> x[i];
  }
  for (int j = 0; j < (int)(n + 1); j++) {
    for (int k = 0; k < (int)(n + 1); k++) {
      for (int s = 0; s < (int)(2505); s++) {
        if (j == 0 && k == 0 && s == 0) {
          dp[j][k][s] = 1;
        } else if (j >= 1 && s < x[j]) {
          dp[j][k][s] = dp[j - 1][k][s];
        } else if (j >= 1 && k >= 1 && s >= x[j]) {
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
        } else {
          dp[j][k][s] = 0;
        }
      }
    }
  }
  ll ans = 0;
  for (int k = 1; k <= (int)(n); k++) {
    ans += dp[n][k][k * a];
  }
  cout << ans << endl;
  return 0;
}
