#include <bits/stdc++.h>
using namespace std;
int n, a;
int arr[51], memo[51][51][2501];
long long solve(int i, int x, int sum) {
  if (memo[i][x][sum] > -1) return memo[i][x][sum];
  long long v;
  if (i == n) {
    if (x && !(sum % x) && sum / x == a)
      v = 1;
    else
      v = 0;
  } else {
    v = solve(i + 1, x, sum) + solve(i + 1, x + 1, sum + arr[i]);
  }
  memo[i][x][sum] = v;
  return v;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(arr, -1, sizeof(memo));
  cin >> n >> a;
  for (int i = 0; i < n; i++) cin >> arr[i];
  cout << solve(0, 0, 0);
}
