#include <bits/stdc++.h>
using namespace std;
long dp[55][55][600];
int main() {
  int n, v;
  cin >> n >> v;
  long x[n];
  for (int i = 0; i < n; ++i) cin >> x[i];
  dp[0][0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      for (int k = 0; k < 550; ++k) {
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
      }
    }
  }
  long ans = 0;
  for (int i = 1; i <= n; ++i) ans += dp[n][i][i * v];
  cout << ans << endl;
}
