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