#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod=1e9+7;

int main(){
  int N,A,x[50];
  cin>>N>>A;
  for (int i(0);i<N;i++) cin>>x[i];
  for (int i(0);i<N;i++) x[i]-=A;
  ll dp[50][5001]={0};
  dp[0][2499]=1;
  dp[0][x[0]+2499]+=1;
  for (int i(0);i<N-1;i++){
    for (int j(0);j<=5000;j++){
      if (dp[i][j]!=0){
        dp[i+1][j] += dp[i][j];
        dp[i+1][j+x[i+1]] += dp[i][j];
      }
    }
  }
  cout << dp[N-1][2499] -1  << endl;
  return 0;
}

