#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  ll ans=0;
  ll x[n+10]={};
  int dp[n+10][n+10][50*n+10]={};
  ll sum=0;
  dp[0][0][0]=1;
  for(int i=0;i<n;i++)
    cin>>x[i];
  for(int i=1;i<=n;i++){
    for(int j=0;j<=n;j++){
      for(int k=0;k<=50*n;k++){
	if(i>=1&&j>=1&&k>=x[i-1])
	  dp[i][j][k]=dp[i-1][j][k]+dp[i-1][j-1][k-x[i-1]];
	else if(i>=1&&k<x[i-1]){
	  dp[i][j][k]=dp[i-1][j][k];
	}else
	  dp[i][j][k]=0;
      }
    }
  }
  for(int i=1;i<=n;i++){
    ans+=dp[n][i][i*m];
  }
  cout<<ans<<endl;
  return 0;
}
