#include <bits/stdc++.h>
using namespace std;
const int INF = numeric_limits<int>::max();
const long long LLINF = numeric_limits<long long>::max();
const unsigned long long ULLINF = numeric_limits<unsigned long long>::max();
const double PI = acos(-1.0);
long long dp[55][55][2510];
int x[55];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a;
  cin >> n >> a;
  for (int i = 1; i <= n; i++) cin >> x[i];
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    dp[i][0][0] = 1;
    for (int k = 1; k <= i; k++)
      for (int s = 1; s <= 2500; s++)
        dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - x[i]];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[n][i][i * a];
  cout << ans;
  return 0;
}
