#include <bits/stdc++.h>
using namespace std;
long long int replac(string s) {
  double ans = 0;
  for (long long int i = 0; i < s.length(); i++) {
    ans += (s[i] - '0') * pow(10, s.length() - i - 1);
  }
  return (long long int)ans;
}
vector<pair<long long int, long long int> > vii;
long long int memo[55][3000], n, m, s[100];
long long int keisan(long long int num, long long int sum, long long int cou) {
  if (memo[num][sum]) return memo[num][sum];
  if (num >= n) {
    if (!cou) return 0;
    if (sum % cou || (sum / cou) != m)
      return 0;
    else
      return 1;
  } else {
    return memo[num][sum] = keisan(num + 1, sum, cou) +
                            keisan(num + 1, sum + s[num], cou + 1);
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  fill((long long int*)memo, (long long int*)memo + 3000, 0);
  cin >> n >> m;
  for (long long int i = 0; i < n; i++) {
    cin >> s[i];
  }
  long long int ans = 0;
  ans = keisan(0, 0, 0);
  cout << ans << endl;
  return 0;
}
