#include <bits/stdc++.h>
using namespace std;
int N, A;
long long dp[51][51][5050];
int v[51];
int main() {
  int mini = 100;
  long long rez = 0;
  scanf("%d %d", &N, &A);
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &v[i]);
    mini = min(v[i], mini);
    dp[i][0][0] = 1;
  }
  dp[0][0][0] = 1;
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= i; ++j) {
      for (int k = mini; k <= 5050; ++k) {
        dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - v[i]];
      }
    }
  }
  for (int i = 1; i <= N; ++i) {
    rez += dp[N][i][i * A];
  }
  printf("%lld", rez);
  return 0;
}
