#include <bits/stdc++.h>
using namespace std;
long long dp[51][51][251];
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int(i) = (0); (i) < (int)(N); ++(i)) scanf("%d", &x[i]);
  dp[0][0][0] = 1;
  for (int(i) = (0); (i) < (int)(N); ++(i))
    for (int(j) = (0); (j) < (int)(N); ++(j))
      for (int(k) = (0); (k) < (int)(251); ++(k)) {
        long long y = dp[i][j][k];
        if (y == 0) continue;
        dp[i + 1][j + 1][k + x[i]] += y;
        dp[i + 1][j][k] += y;
      }
  long long ans = 0;
  for (int(n) = (1); (n) < (int)(N + 1); ++(n))
    for (int(sm) = (0); (sm) < (int)(251); ++(sm)) {
      if (sm % n == 0 && sm / n == A) {
        ans += dp[N][n][sm];
      }
    }
  cout << ans << endl;
}
