#include <bits/stdc++.h>
using namespace std;
int N;
int A;
vector<int> x;
int n;
long long int mem[51][51][51];
long long int solve(int i, int a, int d) {
  if (mem[i][a][d] != -1) return mem[i][a][d];
  if (i >= N || a < x[i] || d > n) return 0;
  if (x[i] == a && d == n - 1)
    mem[i][a][d] = solve(i + 1, a, d) + 1;
  else
    mem[i][a][d] = solve(i + 1, a, d) + solve(i + 1, a - x[i], d + 1);
  return mem[i][a][d];
}
int main() {
  cin >> N;
  cin >> A;
  int i, y;
  for (i = 0; i < N; i++) {
    cin >> y;
    x.push_back(y);
  }
  sort(x.begin(), x.end());
  long long int s = 0;
  for (i = 1; i <= N; i++) {
    n = i;
    memset(mem, -1, sizeof(mem));
    s += solve(0, i * A, 0);
  }
  cout << s << endl;
}
