#include <bits/stdc++.h>
using namespace std;
const int DX[4] = {0, 1, 0, -1}, DY[4] = {-1, 0, 1, 0};
const int INF = 1e9;
const long long INFLL = 1e18;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++)
    os << *i << (i == end(v) - 1 ? "" : " ");
  return os;
}
long long dp[51][5002];
int main(int argc, char const *argv[]) {
  int N, A;
  cin >> N >> A;
  vector<int> x(N), y(N);
  for (int i = 0; i < (int)(N); i++) {
    cin >> x[i];
    y[i] = x[i] - A;
  }
  for (int i = 0; i < (int)(N); i++) {
    dp[i][2500 + y[i]]++;
    for (int j = 0; j < (int)(5002); j++) {
      dp[i + 1][j] += dp[i][j];
      dp[i + 1][j + y[i + 1]] += dp[i][j];
    }
  }
  cout << dp[N - 1][2500] << endl;
  return 0;
}
