#include<cstdio>
#include<cstring>

const int N = 51;
const int M = 2501;

typedef long long LL;

LL dp[N][M];
int n, m, x, sum, a[N];

int main(){
	scanf("%d %d", &n, &m);
	memset(dp, 0, sizeof(dp));
	dp[0][0] = 1;
	sum = 0;
	for(int i=0; i<n; i++){
		scanf("%d", &x);
		sum += x;
        for(int j=i; j>=0; j--){
            for(int k=sum; k>=x; k--){
				dp[j+1][k] += dp[j][k-x];
            }
        }
	}
	LL ans = 0;
	for(int i=1; i<=n; i++){
		ans += dp[i][i*m];
	}
	printf("%lld\n", ans);
	return 0;
}
