#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> X(N);
  for (int i = 0; i < N; i++) {
    cin >> X[i];
    X[i] -= A;
  }
  vector<int> pl;
  vector<int> mn;
  long long zr = 1;
  for (int i = 0; i < N; i++) {
    if (!(X[i])) zr *= 2;
    if (X[i] > 0) pl.push_back(X[i]);
    if (X[i] < 0) mn.push_back(-X[i]);
  }
  vector<long long> dp(2505, 0);
  vector<long long> dp_(2505, 0);
  dp[0] = 1;
  dp_[0] = 1;
  int si = (int)pl.size();
  int si_ = (int)mn.size();
  for (int i = 0; i < si; i++) {
    for (int j = 2504; j >= pl[i]; j--) {
      dp[j] += dp[j - pl[i]];
    }
  }
  for (int i = 0; i < si_; i++) {
    for (int j = 2504; j >= mn[i]; j--) {
      dp_[j] += dp_[j - mn[i]];
    }
  }
  long long ans = 0;
  for (int i = 0; i < 2505; i++) {
    ans += dp[i] * dp_[i];
  }
  cout << ans * zr << endl;
}
