#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const long long MOD = 1000000007;
using namespace std;
long long dp[51][4005];
int main(int argc, char* argv[]) {
  int n, A;
  scanf("%d%d", &n, &A);
  vector<int> a(n);
  int i, j;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i] -= A;
  }
  dp[0][2000] = 1;
  for (i = 0; i < n; i++) {
    for (j = 0; j <= 4000; j++) {
      dp[i + 1][j] += dp[i][j];
      dp[i + 1][j + a[i]] += dp[i][j];
    }
  }
  printf("%lld\n", dp[n][2000] - 1);
  return 0;
}
