#include <bits/stdc++.h>
using namespace std;
const long long ARR = 55;
long long n, a, ans;
long long x[55];
long long d[55][55][2505];
int main() {
  scanf("%lld%lld", &n, &a);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &x[i]);
  }
  d[0][0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= i; j++) {
      for (long long k = 0; k <= n * 50; k++) {
        if (k >= x[i]) {
          d[i][j][k] = d[i - 1][j - 1][k - x[i]] + d[i - 1][j][k];
        } else {
          d[i][j][k] = d[i - 1][j][k];
        }
      }
    }
  }
  for (long long j = 1; j <= n; j++) {
    ans += d[n][j][j * a];
  }
  printf("%lld", ans);
  return 0;
}
