#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);++i)
#define rep(i,n) REP(i, 0, n)
typedef long long int i64;
typedef pair<int, int> pint;

int main() {
    int N, A; cin >> N >> A;
    vector<int> X(N);
    rep(i, N) cin >> X[i];
    vector<vector<i64>> dp(N + 1, vector<int>(2510, 0));
    dp[0][0] = 1LL;
    rep(i, N) {
        auto dp_ = dp;
        int x = X[i];
        rep(j, N) REP(k, x, 2510) {
            dp_[j + 1][k] += dp[j][k - x];
        }
        dp = dp_;
    }
    i64 ans = 0LL;
    REP(i, 1, N + 1)
      ans += dp[i][i * A];
    cout << ans << endl;
    return 0;
}