#include <bits/stdc++.h>
using namespace std;
const char dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
long long dp[51][51][2501];
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> v(n);
  for (int i = 0; i < (n); i++) cin >> v[i];
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (i); j++) {
      for (int k = 0; k < (50 * n); k++) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (k + v[i - 1] < 2501) dp[i][j + 1][k + v[i - 1]] += dp[i - 1][j][k];
      }
    }
  }
  int cnt = 0;
  for (int j = 1; j <= n; j++) {
    cnt += dp[n][j][a * j];
  }
  cout << cnt << endl;
  return 0;
}
