//g++ main.cpp -I /usr/local/include/ac-library
//#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
//using namespace atcoder;
stack<int> st;
queue<int> qu;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define sz(x) (int)(x).size()
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)

ll dp[51][51][2501];

int main(){
    int n,a;
    cin >> n>> a;
    vector<int> x[n+1];
    x[0]=0;
    rep2(i,n){
        cin >> x[i];
    }
    rep(j,n+1){
        rep(k,n+1){
            rep(s,n*50+1){
                if(j==0&&k==0&&s==0){
                    dp[j][k][s]=1;
                }else if(j>=1&&s<x[j]){
                    dp[j][k][s]=dp[j-1][k][s];
                }else if(j>=1&&k>=1&&s>=x[j]){
                    dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j]];
                }else{
                    dp[j][k][s]=0;
                }
            }
        }
    }
    ll ans=0;
    rep2(k,n){
        ans+=dp[n][k][k*a];
    }
    
    cout<<ans<<endl;
    return 0;
}