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