#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const int INF = 1000000007;
int N, A;
int B[51];
long long dfs(int idx, int cost) {
  if (idx == N) {
    return cost == 0 ? 1 : 0;
  }
  long long ans = 0ll;
  ans += dfs(idx + 1, cost + B[idx]);
  ans += dfs(idx + 1, cost);
  return ans;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> A;
  int x;
  for (int i = 0; i < N; ++i) {
    cin >> x;
    B[i] = A - x;
  }
  int ans = dfs(0, 0);
  cout << ans - 1 << "\n";
  return 0;
}
