#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  int dp[1 + n][1 + n * 50];
  for (int i = 0; i <= n; i++) {
    fill(dp[i], dp[i] + n * 50 + 1, 0);
  }
  dp[0][0] = 1;
  for (int v : x) {
    for (int i = n; i > 0; i--) {
      for (int j = 0; j <= n * 50 - v; j++) dp[i][j + v] += dp[i - 1][j];
    }
  }
  long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[i][a * i];
  }
  cout << ans << endl;
  return 0;
}
