#include <bits/stdc++.h>
const int N = 2505;
using namespace std;
long long c[51][N], ar[N], n, a;
int main() {
  cin >> n >> a;
  c[0][0] = 1;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
    for (int j = N - ar[i]; j >= 0; j--) {
      for (int cn = 0; cn <= i; cn++) {
        if (j + ar[i] >= N) continue;
        c[cn + 1][j + ar[i]] += c[cn][j];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    ans += c[i][i * a];
  }
  cout << ans << '\n';
  return 0;
}
