#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
int N,A;
int x[51];
ll dp[51][5001];
int main() {
  cin >> N >> A;
  int MAX = 0;
  for(int i = 0; i < N; i++) {
    cin >> x[i];
    MAX = max(MAX,x[i]);
    x[i] -= A;
  }


  dp[0][MAX * N] = 1;

  for(int i = 0; i < N; i++) {
    for(int k = 0; k < 2 * MAX * N; k++) {
      if(dp[i][k]) {
	dp[i+1][k+x[i]] += dp[i][k];
	dp[i+1][k] += dp[i][k];
      }
    }
  }

  cout << dp[N][MAX*N] - 1 <<endl;
}

  
