//sieu nhan
#include <bits/stdc++.h>
using namespace std;
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
#define rand rd
#define int long long
#define inp "test.inp"
#define out "test.out"
#define oo 55
#define inf 1e15
#define mod 1000000007
#define rese(x,y) memset(x,y,sizeof(x))
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define y1 hungdzno1
int n,A,a[oo],f[oo][oo*100];
void nhap(){
  cin>>n>>A;
  for(int i=1;i<=n;++i) cin>>a[i];
}
void xuly(){
  f[0][2500]=1;
  for(int i=1;i<=n;++i){
		a[i]-=A;
		for(int j=0;j<5001;++j){
			f[i][j]+=f[i-1][j];
			f[i][j+a[i]]+=f[i-1][j];
		}
	}
	cout<<f[n][2500]-1;
}
main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  #ifndef ONLINE_JUDGE
  freopen(inp,"r",stdin);
  freopen(out,"w",stdout);
  #endif
  nhap();
  xuly();
}
