#include <bits/stdc++.h>
using namespace std;
int n;
int a, avg, arr[51];
long long int dp[51][2501][51];
long long int solve(int pos, int sum, long long int cnt) {
  if (pos == n) return 0;
  if (dp[pos][sum][cnt] != -1) return dp[pos][sum][cnt];
  dp[pos][sum][cnt] = 0;
  long long int val1 = 0, val2 = 0;
  if ((sum + arr[pos]) / (cnt + 1) == a && (sum + arr[pos]) % (cnt + 1) == 0) {
    val1 = 1 + solve(pos + 1, sum + arr[pos], cnt + 1);
  } else if ((sum + arr[pos]) / (cnt + 1) < a)
    val1 = solve(pos + 1, sum + arr[pos], cnt + 1);
  val2 = solve(pos + 1, sum, cnt);
  return dp[pos][sum][cnt] += (val1 + val2);
}
int main() {
  while (scanf("%d %d", &n, &a) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    memset(dp, -1, sizeof dp);
    printf("%lld\n", solve(0, 0, 0));
  }
  return 0;
}
