#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a;
  cin >> n >> a;
  vector<long long> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) A[i] -= a;
  long long dp[100][101] = {0};
  dp[0][a] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 101; j++) {
      dp[i + 1][j] = dp[i][j];
      if (j + A[i] >= 0) dp[i + 1][j] += dp[i][j + A[i]];
    }
  cout << dp[n][a] - 1;
}
