#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long mod = 1e9 + 7;
const long long big = 1e18;
const double PI = 2 * asin(1);
int DP[55][3000];
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> arr(N);
  for (int i = 0; i < N; ++i) {
    cin >> arr[i];
    arr[i] -= A;
  }
  DP[0][1500 + arr[0]]++;
  DP[0][1500]++;
  for (int i = 0; i < N - 1; ++i) {
    for (int j = 0; j < 3000; ++j) {
      if (DP[i][j] > 0) {
        DP[i + 1][j] += DP[i][j];
        DP[i + 1][j + arr[i + 1]] += DP[i][j];
      }
    }
  }
  cout << DP[N - 1][1500] - 1 << endl;
}
