#include <bits/stdc++.h>
using namespace std;
const long long INF = (int)1e17 + 7;
int a[51];
long long dp[51][51][50 * 51];
int n, i, s, j, k;
long long sum = 0;
int main() {
  cin >> n >> s;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  dp[0][0][0] = 1;
  for (i = 1; i <= n; i++)
    for (j = 0; j <= i; j++)
      for (k = 0; k <= 2500; k++) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (k >= a[i]) dp[i][j][k] += dp[i - 1][j - 1][k - a[i]];
      }
  for (i = 1; i <= n; i++) {
    sum += dp[n][i][s * i];
  }
  cout << sum;
}
