#include <bits/stdc++.h>
using namespace std;
long long ans, dp[51][51 * 51][50];
int x[51];
int n, a;
int solve(int idx, int rem, int cnt) {
  if (cnt < 0) return 0;
  if (rem < 0) return 0;
  if (idx == n) return !rem && !cnt;
  long long &ret = dp[idx][rem][cnt];
  if (~ret) return ret;
  ret = solve(idx + 1, rem, cnt);
  ret += solve(idx + 1, rem - x[idx], cnt - 1);
  return ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  cin >> n >> a;
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 1; i <= n; ++i) {
    ans += solve(0, a * i, i);
  }
  cout << ans;
}
