#include <bits/stdc++.h>
using namespace std;
int n, ave;
int a[56];
int vis[56];
int dp[56][56][2600];
long long ans = 0;
void dfs(int id, int sum, int num) {
  if (sum % num == 0 && sum / num == ave) ans++;
  if (sum / num > ave) return;
  for (int i = id + 1; i <= n; i++) {
    num++;
    sum += a[i];
    dfs(i, sum, num);
    num--;
    sum -= a[i];
  }
}
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);
}
