#include <bits/stdc++.h>
int dp[2][55][2505];
int main() {
  int n, a;
  int arr[55];
  scanf("%d%d", &n, &a);
  for (int i = 1; i <= n; i++) scanf("%d", &arr[i]);
  dp[0][0][0] = dp[1][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int k = 1; k <= i; k++) {
      for (int j = 0; j <= 2500; j++) {
        dp[i & 1][k][j] = dp[(i & 1) ^ 1][k][j];
        if (j >= arr[i]) dp[i & 1][k][j] += dp[(i & 1) ^ 1][k - 1][j - arr[i]];
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[n & 1][i][i * a];
  printf("%d\n", ans);
  return 0;
}
