#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
const long long MOD = 1e9 + 7;
int N, M, K, Q;
int arr[60];
int dp[3000][60];
int main() {
  int i, j, k;
  long long A;
  scanf("%d%d", &N, &A);
  for (i = 1; i <= N; ++i) scanf("%d", arr + i);
  for (i = 1; i <= N; ++i) {
    for (j = A * N; j > 0; --j) {
      for (k = 2; k <= i; ++k) {
        if (j - arr[i] > 0) dp[j][k] += dp[j - arr[i]][k - 1];
      }
    }
    dp[arr[i]][1]++;
  }
  long long sum = 0;
  for (i = 1; i <= N; ++i) {
    sum += (long long)dp[A * i][i];
  }
  printf("%lld", sum);
}
