#include <bits/stdc++.h>
using namespace std;
const unsigned long long MOD = 1000000007LL;
long long GCD(long long a, long long b) { return b == 0 ? a : GCD(b, a % b); }
long long fast_exp(long long base, long long exp) {
  long long tot = 1;
  for (; exp > 0; exp >>= 1) {
    if ((exp & 1) == 1) tot = tot * base % MOD;
    base = base * base % MOD;
  }
  return tot;
}
unsigned long long arr[100], dp[100][2000];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a;
  cin >> n >> a;
  for (int i = 1; i <= n; ++i) cin >> arr[i];
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int weight = n - 1; weight >= 0; --weight)
      for (int value = 1250; value >= arr[i]; --value)
        dp[weight + 1][value] += dp[weight][value - arr[i]];
  unsigned long long tot = 0;
  for (int nums = 1; nums <= n; ++nums) tot += dp[nums][a * nums];
  cout << tot << "\n";
  return 0;
}
