#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int x[n + 1];
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
  }
  int dp[2][51][2501];
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < n + 1; ++j) {
      for (int k = 0; k <= 2500; ++k) {
        if (!j && !k)
          dp[i][j][k] = 1;
        else
          dp[i][j][k] = 0;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      for (int k = 0; k <= 2500; ++k) {
        dp[1][j][k] = dp[0][j][k] +
                      (j >= 1 && k - x[i] >= 0 ? dp[0][j - 1][k - x[i]] : 0);
      }
    }
    for (int j = 0; j <= i; ++j) {
      for (int k = 0; k <= 2500; ++k) {
        dp[0][j][k] = dp[1][j][k];
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += dp[1][i][i * a];
  }
  cout << ans << endl;
  return 0;
}
