#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const int N = (int)2e5 + 7;
int n, a;
int x[51];
long long dp[51][51][2501];
long long sum;
int main() {
  scanf("%d%d", &n, &a);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k <= 2500; k++) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (j > 0) dp[i][j][k] += dp[i - 1][j - 1][k - x[i]];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    sum += dp[n][i][a * i];
  }
  printf("%lld", sum);
}
