#include <bits/stdc++.h>
using namespace std;
long long dp[60][60][301];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, A;
  cin >> N >> A;
  vector<long long> x;
  for (long long i = (long long)0; i < (long long)N; i++) {
    long long inp;
    cin >> inp;
    x.push_back(inp);
  }
  for (long long i = (long long)0; i < (long long)N; i++) dp[i][0][0] = 1;
  dp[0][1][x[0]] = 1;
  for (long long i = 1; i < N; i++) {
    for (long long j = 0; j <= N; j++) {
      for (long long k = 0; k <= 300; k++) {
        if (k < x[i])
          dp[i][j][k] = dp[i - 1][j][k];
        else
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
      }
    }
  }
  long long ans = 0;
  for (long long i = (long long)0; i < (long long)N; i++) {
    ans += dp[N - 1][i][i * A];
  }
  cout << ans << endl;
  return 0;
}
