#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 50;
const int MAX_W = 5050;
int N, A;
int x[50];
int value;
long long dp[MAX_N][MAX_W];
long long get0(int i, int j) {
  if (dp[i][j + 2500] != -6000) {
    return dp[i][j + 2500];
  }
  long long res = 0;
  if (i == N) {
    if (j == 0) res = 1;
  } else {
    res = get0(i + 1, j + x[i]) + get0(i + 1, j);
  }
  return dp[i][j + 2500] = res;
}
int main() {
  FILE* fp_in = freopen("input.txt", "r", stdin);
  for (int i = 0; i < MAX_N; i++) {
    for (int j = 0; j < MAX_W; j++) {
      dp[i][j] = -6000;
    }
  }
  cin >> N >> A;
  for (int i = 0; i < N; i++) {
    cin >> value;
    x[i] = value - A;
  }
  cout << get0(0, 0) - 1 << endl;
  return 0;
}
