#include <iostream>
#include<math.h>
#include<string.h>
#include<algorithm>
typedef long long int ll;
using namespace std;
int main(){
    ll n,a,s,x,i,j;
    cin>>n>>a;
    ll k[n],sum[10000][n+1];
    memset(sum,10000*n*sizeof(int),0);
    for(i=0;i<n;i++){
        cin>>s;
        k[i]=s-a;
    }

    sum[5000][0]=1;
    for(i=0;i<n;i++){
        for(j=0;j<10000;j++){
            if(0<=j-k[i]&&j-k[i]<10000)x=sum[j-k[i]][i];
            else x=0;
            sum[j][i+1]=sum[j][i]+x;
        }
    }

    cout<<sum[5000][n]-1<<endl;

}