#include <bits/stdc++.h>
using namespace std;
int n;
int a;
int x[50];
long long int memo[50][50][2500];
long long int solve(int idx, int cnt, int sum) {
  if (idx == n && cnt != 0 && sum % cnt == 0 && sum / cnt == a) return 1;
  if (idx > n) return 0;
  if (memo[idx][cnt][sum] != -1) return memo[idx][cnt][sum];
  return memo[idx][cnt][sum] =
             solve(idx + 1, cnt + 1, sum + x[idx]) + solve(idx + 1, cnt, sum);
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  memset(memo, -1, sizeof(memo));
  cout << solve(0, 0, 0) << endl;
}
