#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, a;
  cin >> n >> a;
  int x[n];
  for (int i = 0; i < n; ++i) {
    int xi;
    cin >> xi;
    x[i] = xi - a;
  }
  unsigned long long dp[n][50 * n * 2 + 1];
  for (int j = 0; j < 50 * n * 2 + 1; ++j) {
    dp[0][j] = 0;
  }
  dp[0][50 * n] = 1;
  dp[0][50 * n + x[0]] = 1;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < 50 * n * 2 + 1; ++j) {
      dp[i][j] = dp[i - 1][j] + dp[i - 1][j - x[i]];
    }
  }
  cout << dp[n - 1][50 * n] - 1 << endl;
  return 0;
}
