#include <bits/stdc++.h>
using namespace std;
long long int dp[50][10000];
int x[50];
long long int dp2(int p, int q) {
  if (dp[p][q] != -1) {
    return dp[p][q];
  }
  if (p == 0) {
    if ((x[0] + 5000) == q && q == 5000) {
      return dp[p][q] = 2;
    } else if ((x[0] + 5000) == q || q == 5000) {
      return dp[p][q] = 2;
    } else {
      return dp[p][q] = 0;
    }
  }
  long long int count = dp2(p - 1, q);
  count += dp2(p - 1, q - x[p]);
  return dp[p][q] = count;
}
int main() {
  int n, a;
  cin >> n >> a;
  for (int i = 0; i < 50; i++) {
    for (int j = 0; j < 10000; j++) {
      dp[i][j] = -1;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    x[i] -= a;
  }
  cout << dp2(n - 1, 5000) - 1 << endl;
}
