// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



using VS = vector<string>;    using LL = long long;

using VI = vector<int>;       using VVI = vector<VI>;

using PII = pair<int, int>;   using PLL = pair<LL, LL>;

using VL = vector<LL>;        using VVL = vector<VL>;



#define ALL(a)  begin((a)),end((a))

#define RALL(a) (a).rbegin(), (a).rend()

#define PB push_back

#define EB emplace_back

#define MP make_pair

#define SZ(a) int((a).size())

#define SORT(c) sort(ALL((c)))

#define RSORT(c) sort(RALL((c)))

#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)

#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)

#define debug(x) cerr << #x << ": " << x << endl

const int INF = 1e9;                          const LL LINF = 1e16;

const LL MOD = 1000000007;                    const double PI = acos(-1.0);

int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };



/* -----  2018/02/14  Problem: 060_arc_a / Link: https://arc060.contest.atcoder.jp/tasks/arc060_a?lang=en  ----- */

/* ------問題------







-----問題ここまで----- */

/* -----解説等-----







----解説ここまで---- */



LL N, A;



LL ans = 0LL;



int main() {

	cin.tie(0);

	ios_base::sync_with_stdio(false);



	cin >> N >> A;

	VI a(N);

	FOR(i, 0, N) {

		cin >> a[i];

	}

	vector<VVL> dp(N + 1, VVL(N + 1, VL(2501, 0)));

	dp[0][0][0] = 1;

	FOR(i, 0, N) {

		FOR(k, 0, N) {

			FOR(val, 0, 2501) {

				if(val+a[i]<=2500)dp[i + 1][k + 1][val + a[i]] += dp[i][k][val];

				dp[i + 1][k][val] += dp[i][k][val];

			}

		}

	}

	FOR(i, 1, N+1) {

		ans += dp[N][i][i*A];

	}



	cout << ans << "\n";



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.7363233650231047x):
#include<bits/stdc++.h>

#define sci(a) scanf("%d", &a)

#define fto(i, a, b) for (int i = a; i <= b; ++i)

#define fdto(i, a, b) for (int i = a; i >= b; --i)

#define scii(a, b) scanf("%d %d", &a, &b)

#define ll long long

#define ff first

#define ss second

#define vi vector<int>

#define pi pair<int, int>

#define maxN 100005

#define oo 1000000007

#define maxM 2500

#define mp make_pair

#define pb push_back

#define bug(a) cout << #a << "= " << a << endl;

#define bugarr(a, x, y) cout << #a << "[" << x << ", " << y << "]= "; for (int i = x; i <= y; ++i) cout << a[i] << ", "; cout << endl;

#define sz(a) (int)a.size()

#define vii vector<pi>

#define db double

#define forit(var, it) for(__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)



using namespace std;



int n, A, a[100];

ll f[100][10005];



int main() {

   // #ifndef ONLINE_JUDGE

      //  freopen("TakandCards.inp", "r", stdin);

        //freopen("TakandCards.out", "w", stdout);

    //#endif // ONLINE_JUDGE



    scii(n, A);

    fto(i, 1, n) sci(a[i]);

    fto(i, 1, n) a[i]-=A;

    //fto(i, 1, n) cout << a[i] << "\n";

    fto(i, 0, 7000) f[0][i] = 0;

    f[0][2500] = 1;

    fto(i, 1, n) {

        fto(j, -2500, 2500) {

            f[i][j+maxM] = f[i-1][j+maxM];

            if (j - a[i] + maxM >= 0) f[i][j+maxM]+=f[i-1][j-a[i]+maxM];

            //cout << i << " " << j << " " << j-a[i] << " " << f[i][j+maxM] << "\n";

        }

    }

    //cout << f[1][maxM] << "\n";

    cout << f[n][maxM] - 1;



    return 0;

}