#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
const int maxm = maxn * 2;
const int inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
int n, m, a[55];
int dp[55][55][2505];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k <= n * 50; k++) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (j >= 1 && k >= a[i]) dp[i][j][k] += dp[i - 1][j - 1][k - a[i]];
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[n][i][i * m];
  cout << ans << '\n';
  return 0;
}
