#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1000000007; 
const int INF = 1000000000; //1e9
const int NIL = -1;
const long long LINF = 1000000000000000000; // 1e18
const long double EPS = 1E-10;

template<class T, class S> inline bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S> inline bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}






int main(){
    int N, A, mx; std::cin >> N >> A;
    mx = A;
    std::vector<int> x(N);
    for(int i(0); i < N; ++i){
        std::cin >> x[i];
        chmax(mx, x);
    }
    //dp[i][j][k]: x[0],..,x[i-1]からj枚で和がk
    std::vector<std::vector<std::vector<long long>>> dp(N+1, 
     std::vector<std::vector<long long>>(N+1, 
     std::vector<long long>(N*mx + 1, 0)));
    dp[0][0][0] = 1;
    for(int i(1); i <= N; ++i){
        for(int j(0); j <= N; ++j){
            for(int k(0), k_len(N*mx); k <= k_len; ++k){
                dp[i][j][k] = dp[i-1][j][k];
                if(j && k >= x[i-1])
                    dp[i][j][k] += dp[i-1][j-1][k - x[i-1]];
            }
        }
    }
    long long ans(0);
    for(int i(1); i <= N; ++i){
        ans += dp[N][i][A*i];
    }
    std::cout << ans << std::endl;
    return 0;
}
