#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll dp[51][51][2501];
int main() {
  int n, a;
  cin >> n >> a;
  vector<ll> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  dp[0][0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k < 2501; k++) {
        if (dp[i][j][k]) {
          dp[i + 1][j][k] += dp[i][j][k];
          dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
        }
      }
    }
  }
  ll cnt = 0;
  for (int i = 1; i * a <= (2500); i++) {
    cnt += dp[n][i][a * i];
  }
  cout << cnt << endl;
}
