#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define LL long long
#define st first
#define nd second
using namespace std;
LL dp[2501][51];
int main(){
    LL n,a,t,ans=0;
    cin>>n>>a;
    dp[0][0]=1;
    for(int i=0;i<n;++i){
        cin>>t;
        for(int j=2500;j>=t;--j)
            for(int o=0;o<=i;++o)
                dp[j][o+1]+=dp[j-t][o];
    }
    for(int i=1;i<=2500;++i){
        if(i%a!=0||i/a>n)
            continue;
        ans+=dp[i][i/a];
    }
    cout<<ans<<endl;
}

