#include <bits/stdc++.h>
using namespace std;
const int maxn = 55;
long long n, a[maxn], dp[maxn][maxn][maxn], av;
long long calc(int x, int num, int have) {
  if (x == n) {
    double avg = (double)have / (double)num;
    if (avg == av)
      return 1;
    else
      return 0;
  }
  if (dp[x][num][have] != -1) return dp[x][num][have];
  long long take = calc(x + 1, num + 1, have + a[x]);
  long long dont = calc(x + 1, num, have);
  return dp[x][num][have] = dont + take;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  memset(dp, -1, sizeof(dp));
  cin >> n >> av;
  for (int i = 0; i < n; i++) cin >> a[i];
  cout << calc(0, 0, 0);
}
