#include <bits/stdc++.h>
#pragma GCC Optimize("O3")
using namespace std;
const int N = 30, M = N * N, OO = 0x3f3f3f3f;
int n, avg, arr[55];
long long mem[55][55][55];
long long solve(int idx, int sum, int noe) {
  if (idx == n) {
    if (noe == 0 || sum % noe) return 0;
    if (sum / noe == avg) return 1;
    return 0;
  }
  long long &ret = mem[idx][sum][noe];
  if (~ret) return ret;
  return ret =
             solve(idx + 1, sum, noe) + solve(idx + 1, sum + arr[idx], noe + 1);
}
int main() {
  scanf("%d%d", &n, &avg);
  for (int i = 0; i < n; i++) scanf("%d", arr + i);
  memset(mem, -1, sizeof mem);
  printf("%lld", solve(0, 0, 0));
}
