#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a;
  cin >> a;
  vector<int> x(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  long long ans = 0;
  vvll dp(251, vll(n + 1, 0LL));
  dp[0][0] = 1LL;
  for (int i = 0; i < n; ++i) {
    for (int j = 250; j >= x[i]; --j) {
      for (int k = 0; k <= i; k++) {
        dp[j][k + 1] += dp[j - x[i]][k];
      }
    }
  }
  for (int k = 1; k <= n; k++) {
    int t = a * k;
    ans += dp[t][k];
  }
  cout << ans << endl;
  return 0;
}
