#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int main() {
  int n, a, x;
  cin >> n >> a;
  int f[60][2600];
  memset(f, 0, sizeof(f));
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    for (int j = i; j > 0; j--) {
      for (int k = 2500; k >= x; k--) {
        f[j][k] += f[j - 1][k - x];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += f[i][a * i];
  cout << ans << endl;
  return 0;
}
