#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, A;
  cin >> N >> A;
  vector<int64_t> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
    vec.at(i) -= A;
  }
  int64_t dp[N + 1][110];
  int64_t plus = 50;
  for (int i = 0; i < N + 1; i++) {
    for (int j = 0; j < 110; j++) {
      dp[i][j] = 0;
    }
  }
  for (int i = 0; i < N + 1; i++) {
    dp[i][0 + plus] = 1;
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 110; j++) {
      dp[i + 1][j] = dp[i][j] + dp[i][j - vec.at(i)];
    }
  }
  cout << dp[N][0 + plus] - 1 << endl;
}
