#include <bits/stdc++.h>
using ll = long long;
using namespace std;

int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);

  int n, m;
  cin >> n >> m;
  vector<vector<ll>> dp(n + 1, vector<ll>(60 * 60));
  dp[0][0] = 1;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    int mx = 50 * 50 - x;
    for (int j = i; j >= 0; --j)
      for (int v = mx; v >= 0; --v) dp[j + 1][v + x] += dp[j][v];
  }

  ll ans = 0;
  for (int i = 1; i <= n; ++i) ans += dp[i][m * i];
  cout << ans;
}