#include <bits/stdc++.h>
using namespace std;
int n, ave;
int a[2560];
int dp[56][56][2600];
long long ans = 0;
int main() {
  scanf("%d%d", &n, &ave);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j >= 0; j--) {
      for (int k = ave * n + 1; k >= 0; k--) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (j >= 1 && k >= a[i - 1])
          dp[i][j][k] += dp[i - 1][j - 1][k - a[i - 1]];
      }
    }
  }
  for (int i = 1; i <= n; i++) ans += dp[n][i][ave * i];
  printf("%lld\n", ans);
}
