#include <bits/stdc++.h>
using namespace std;
int vs[100];
int dp[60][2600];
int main(void) {
  int n;
  int avg;
  scanf("%d%d", &n, &avg);
  dp[0][0] = 1;
  for (int i = 0; i < (int)(n); ++i) {
    int v;
    scanf("%d", &v);
    for (int j = i; j >= 0; --j) {
      for (int k = 2500; k >= 0; --k) {
        dp[j + 1][k + v] += dp[j][k];
      }
    }
  }
  long long res = 0;
  for (int i = 1; i <= n; ++i) {
    res += dp[i][i * avg];
  }
  printf("%lld\n", res);
  return 0;
}
