#include <bits/stdc++.h>
using namespace std;
long long int dp[55][55][555];
int main(void) {
  long long int n, a, t;
  cin >> n >> a;
  vector<long long int> x;
  x.push_back(0);
  for (int i = 0; i < n; i++) {
    cin >> t;
    x.push_back(t);
  }
  for (long long int j = 0; j <= n; j++) {
    for (long long int k = 0; k <= n; k++) {
      for (long long int s = 0; s <= n * 50; s++) {
        if ((j == 0) && (k == 0) && (s == 0))
          dp[j][k][s] = 1;
        else if ((j >= 1) && (s < x[j]))
          dp[j][k][s] = dp[j - 1][k][s];
        else if ((j >= 1) && (k >= 1) && (s >= x[j]))
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
      }
    }
  }
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    ans += dp[n][i][i * a];
  }
  cout << ans << endl;
  return 0;
}
