#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
const int INF = 1e9;
const ll INFLL = 1e18;
template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){
    os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T>ostream&operator<<(ostream &os,const vector<T> &v){
    ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;}
//------------------------------------------------------------------------------

ll dp[50][5002];
int main_(int argc, char const *argv[]) {
    int N,A;
    cin>>N>>A;
    vector<int> x(N),y(N);
    REP(i,N) {
        cin>>x[i];
        y[i]=x[i]-A;
    }

    FOR(i,0,N) {
        dp[i][2501+y[i]]++;
        REP(j,5002) {
            dp[i+1][j]+=dp[i][j];
            if(0<=j+y[i+1] && j+y[i+1]<5000) dp[i+1][j+y[i+1]]+=dp[i][j];
        }
    }
    cout<<dp[N-1][2501]<<endl;
    return 0;
}
