#include <bits/stdc++.h>
using namespace std;
int N, A;
long long dp[51][2501], ans;
vector<int> a(N);
int main() {
  cin >> N >> A;
  for (int& x : a) cin >> x;
  dp[0][0] = 1;
  for (int x : a) {
    for (int k = 50; k >= 0; k--)
      for (int y = 0; y <= 2500; y++) {
        if (!dp[k][y]) continue;
        dp[k + 1][y + x] += dp[k][y];
      }
  }
  for (int k = 1; k <= 50; k++)
    for (int y = 0; y <= 2500; y++)
      if (k * A == y) ans += dp[k][y];
  cout << ans;
  return 0;
}
