#include <bits/stdc++.h>
using namespace std;
long long N, K;
long long A[60];
long long dp[60][2510] = {0};
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    A[i] -= K;
  }
  dp[0][2500] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 5000; j++) {
      if (dp[i][j] == 0) {
        continue;
      }
      dp[i + 1][A[i] + j] += dp[i][j];
      dp[i + 1][j] += dp[i][j];
    }
  }
  printf("%lld\n", dp[N][2500] - 1);
}
