// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define REP(i,n) for(int i=0;i<n;i++)

#define rep(i,n) for(int i=0;i<n;i++)

#define INF 1<<29

#define LINF LLONG_MAX/3

#define MP make_pair

#define PB push_back

#define EB emplace_back

#define ALL(v) (v).begin(),(v).end()

#define debug(x) cerr<<#x<<":"<<x<<endl

#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl

template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }



typedef long long ll;

typedef unsigned long long ull;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef vector<vi> vvi;



ll n,a;

vector<ll> x;



ll dp[64][64][3001];

// dp[i][j][k]:=x[0]...x[j-1]からi枚選んで総和をkにするカードの選び方の数



int main(){

    cin>>n>>a;

//    debug2(n,a);

    rep(i,n){

        ll xx;cin>>xx;

        x.push_back(xx);

    }



    for(int i=0;i<=n;i++){

        dp[0][i][0]=1;

    }

    //dp[0][0][0]=0;



    for(int i=1;i<=n;i++){

        for(int j=1;j<=n;j++){

            for(int k=3000;k>=0;k--){

                dp[i][j][k] += dp[i][j-1][k];

                if(k-x[j-1]>=0){

                    dp[i][j][k] += dp[i-1][j-1][k-x[j-1]];

                }

            }

        }

    }



//    for(int i=0;i<=n;i++){

//        cout << i << endl;

//        cout << "xi ";

//        for(ll j=0;j<35;j++){

//            printf("%2lld ",j);

//        }

//        cout << endl;

//        for(int j=0;j<=n;j++){

//            if(j==0) cout << ".." << " ";

//            else printf("%2lld ",x[j-1]);

//            for(int k=0;k<35;k++){

////                cout << dp[i][j][k] << " ";

//                printf("%2lld ",dp[i][j][k]);

//            }

//            cout << endl;

//        }

//        cout << endl;

//    }



    ll ans=0;

    for(int i=1;i<=n;i++) ans += dp[i][n][a*i];



    cout << ans << endl;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

/*{{{*/  //template

#define rep(i,n) for(int i=0;i<n;i++)

constexpr int INF = numeric_limits<int>::max()/2;

constexpr long long LINF = numeric_limits<long long>::max()/3;

#define mp make_pair

#define pb push_back

#define eb emplace_back

#define fi first

#define se second

#define all(v) (v).begin(),(v).end()

#define sz(x) (int)(x).size()

#define debug(x) cerr<<#x<<":"<<x<<endl

#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl

//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;

struct Double{ double d; explicit Double(double x) : d(x){} };

ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }

template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }

template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }

template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }

template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }

typedef long long ll;

typedef unsigned long long ull;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef vector<vi> vvi;

ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }

//constexpr double eps = 1e-14; 

constexpr double eps = 1e-10; 

constexpr ll mod = 1e9+7;

const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};

/*}}}*/



ll dp[51][51][3000]; // dp[i][j][k] := x[0]...x[i-1]からj個選んだ合計がk



int main(){

    int N; cin >> N;

    int A; cin >> A;

    vi x(N); rep(i,N) cin >> x[i];



    dp[0][0][0] = 1;

    for(int i=0;i<N;i++){

        for(int j=0;j<=i;j++){

            for(int k=0;k<=2500;k++){

                // select x[i]

                dp[i+1][j+1][k+x[i]] += dp[i][j][k];

                // no select x[i]

                dp[i+1][j][k] += dp[i][j][k];

            }

        }

    }



    ll ans = 0;

    for(int i=1;i<=N;i++){

        ans += dp[N][i][i*A];

    }

    cout << ans << endl;

}

// Fastest known solution for this problem: