#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, A;
  cin >> N >> A;
  vector<int> x;
  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    x.push_back(tmp);
  }
  vector<vector<vector<long long> > > dp(N + 1);
  for (int i = 0; i <= N; ++i) {
    dp[i].resize(N + 1);
    for (int j = 0; j <= N; ++j) {
      dp[i][j].resize(50 * N);
      for (int k = 0; k < 50 * N; ++k) {
        dp[i][j][k] = (j == 0 && k == 0) ? 1LL : 0LL;
      }
    }
  }
  for (int i = 1; i <= N; ++i) {
    int next = x[i - 1];
    for (int j = 1; j <= N; ++j) {
      for (int k = 0; k < 50 * N; ++k) {
        if (j <= i) {
          if (k - next < 0) {
            dp[i][j][k] = dp[i - 1][j][k];
          } else {
            dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - next];
          }
        } else
          dp[i][j][k] = 0LL;
      }
    }
  }
  cout << "Here" << endl;
  for (int i = 1; i <= N; ++i)
    for (int j = 1; j <= N; ++j) {
      for (int k = 0; k < 50 * N; ++k)
        if (dp[i][j][k] > 0)
          ;
    }
  long long total = 0LL;
  for (int j = 1; j <= N; ++j) {
    total += dp[N][j][A * j];
  }
  cout << total << endl;
  return 0;
}
