#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, A;
  cin >> N >> A;
  vector<int> v(N);
  for (int i = 0; i < N; i++) {
    cin >> v[i];
  }
  long long cnt[51][300][51] = {};
  cnt[0][0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int sum = 0; sum < 300; sum++) {
      for (int k = 0; k < N; k++) {
        cnt[i + 1][sum + v[i]][k + 1] += cnt[i][sum][k];
        cnt[i + 1][sum][k] += cnt[i][sum][k];
      }
    }
  }
  long long ans = 0;
  for (int sum = 0; sum < 300; sum++) {
    for (int k = 0; k < 300; k++) {
      if (k == 0) continue;
      if (A * k == sum) {
        ans += cnt[N][sum][k];
      }
    }
  }
  cout << ans << endl;
}
