#include <bits/stdc++.h>
using namespace std;
int n, a, x[55], dp[55][55][2505] = {};
bool vis[55][55][2505] = {};
long long rec(int i, int j, int k) {
  if (i < j || k < 0 || j < 0) return 0;
  if (vis[i][j][k]) return dp[i][j][k];
  if (i == 0) return 0;
  vis[i][j][k] = 1;
  dp[i][j][k] = rec(i - 1, j, k) + rec(i - 1, j - 1, k - x[i]);
  return dp[i][j][k];
}
int main() {
  cin >> n >> a;
  for (int i = 0; i++ < n;) cin >> x[i];
  long long ans = 0;
  dp[0][0][0] = 1;
  vis[0][0][0] = 1;
  for (int i = 0; i++ < n;) ans += rec(n, i, i * a);
  cout << ans << endl;
}
