#include <bits/stdc++.h>
using namespace std;
int x[60];
long long f[60][2600];
int main() {
  int n, A;
  scanf("%d%d", &n, &A);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  f[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = n; j >= 1; j--) {
      for (int k = 2500; k >= x[i]; k--) {
        f[j][k] += f[j - 1][k - x[i]];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += f[i][i * A];
  }
  printf("%I64d\n", ans);
  return 0;
}
