#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class PalseError {};
class Edge {
 public:
  LL from, to, value;
  Edge(LL a, LL b, LL c) {
    from = a;
    to = b;
    value = c;
  }
  Edge(LL a, LL b) {
    from = a;
    to = b;
  }
};
LL dp[100][100][1000];
int main() {
  int(N);
  cin >> (N);
  int(A);
  cin >> (A);
  vector<int> vec;
  for (int a = 0; a < (N); ++a) {
    int(b);
    cin >> (b);
    vec.push_back(b);
  }
  dp[0][0][0] = 1;
  for (int a = 0; a < N; a++) {
    for (int b = 0; b <= N; b++) {
      for (int c = 0; c < 1000; c++) {
        dp[a + 1][b + 1][c + vec.at(a)] += dp[a][b][c];
        dp[a + 1][b][c] += dp[a][b][c];
      }
    }
  }
  LL ans = 0;
  for (int a = 1; a <= N; a++) {
    ans += dp[N][a][a * A];
  }
  cout << ans << endl;
  return 0;
}
