#include <bits/stdc++.h>
using namespace std;
using lint = long long;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (auto &i : x) {
    cin >> i;
  }
  vector<vector<vector<lint>>> dp(
      2, vector<vector<lint>>(n + 2, vector<lint>(3000, 0)));
  dp[n & 1][0][0] = 1;
  for (int i = n - 1; i >= 0; i--) {
    for (int picked = 0; picked <= n; picked++) {
      for (int sum = 0; sum < 2600; sum++) {
        dp[i & 1][picked][sum] = dp[(i + 1) & 1][picked][sum];
        ;
      }
    }
    for (int picked = 1; picked < n; picked++) {
      for (int sum = x[i]; sum <= 2600; sum++) {
        dp[i & 1][picked][sum] += dp[(i + 1) & 1][picked - 1][sum - x[i]];
      }
    }
  }
  lint ans = 0;
  for (int picked = 1; picked <= n; picked++) {
    ans += dp[0][picked][a * picked];
  }
  cout << ans << "\n";
  return 0;
}
