#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long MAX = 1e10;
const int BITSIZE = 1 << 17;
const long long p = 7 + 1e9;
const int SIZE = 2 * 1e5;
long long DP[51][2501][51];
int main() {
  int N, M, A, x;
  string s;
  cin >> N >> A;
  DP[0][0][0] = 1;
  for (long long i = (0); i < (long long)(N); i++) {
    cin >> x;
    for (long long k = (0); k < (long long)(N * 50 + 1); k++) {
      for (long long j = (0); j < (long long)(N); j++) {
        DP[i + 1][k + x][j + 1] += DP[i][k][j];
        DP[i + 1][k][j] += DP[i][k][j];
      }
    }
  }
  long long ans = 0;
  for (long long i = (1); i < (long long)(N + 1); i++) {
    ans += DP[N][A * i][i];
  }
  cout << ans << endl;
  return 0;
}
