#include<iostream>
#include<cstdio>
#include<string>
#include<cfloat>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<cstring>
#include<queue>
#include<map>
#include<functional>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
const int mod = 1e9+7;
const int INFINT = INT_MAX/2;
typedef long long ll;
typedef unsigned long long ull;

int main(){
    int N, A;
    cin >> N >> A;
    vector<int> x(N);
    for (int i=0;i<N;i++){
        cin >> x[i];
    }
    ull dp[N+1][N+1][50*50+1] = {};
    for (int i=0;i<N+1;i++){
        for (int j=0;j<N+1;j++){
            for (int k=0;k<50*N+1;k++){
                if(i==0 && j==0 && k == 0){
                    dp[i][j][k] = 1;
                }else if(i>=1 && k < x[i-1]){
                    dp[i][j][k] = dp[i-1][j][k];
                }else if(i>=1 && j>=1 && k >= x[i-1]){
                    dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-x[i-1]];
                }else{
                    dp[i][j][k] = 0;
                }
            }
        }
    }
    ull res = 0ull;
    for (int i=1;i<N;i++){
        res += dp[N][i][A*i];
    }
    cout << res << endl;
    return 0;
}