#include <bits/stdc++.h>
constexpr long MOD = 1e9 + 7;
using namespace std;
int dp[51][3000][51];
int xs[51];
int main() {
  int n, a;
  cin >> n >> a;
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> xs[i + 1];
  }
  dp[0][0][0] = 1;
  for (int i = 1; i < 51; i++) {
    for (int(j) = 0; (j) < (3000); (j)++) {
      for (int(k) = 0; (k) < (51); (k)++) {
        if (j - xs[i] >= 0 && k > 0) {
          dp[i][j][k] = dp[i - 1][j - xs[i]][k - 1] + dp[i - 1][j][k];
        } else {
          dp[i][j][k] = dp[i - 1][j][k];
        }
      }
    }
  }
  long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[n][a * i][i];
  }
  cout << ans << endl;
}
