/*input
3 8
6 6 9
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()
#define all(x) beg(x), en(x)
#define resz resize

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;
const ld PI = 4*atan((ld)1);

ll dp[51][2501][51];
vl x;
ll N, A, ans;
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> N >> A;
	x.pb(0);
	ll sum = 0;
	FOR(i, 1, N + 1) {
		x.pb(0); cin >> x[i];
		sum += x[i];
	}

	dp[0][0][0] = 1;
	ll tot = 0;
	FOR(i, 1, N + 1) {
		F0R(j, sum + 1) {
			F0R(k, i + 1) {
				dp[i][j][k] = dp[i - 1][j][k];
				if (x[i] <= j) dp[i][j][k] += dp[i - 1][j - x[i]][k - 1];
				//cout << dp[i][j][k] << " ";
			}
			//cout << '\n';
		}
		//cout << '\n';
	}
	//cout << tot << '\n';
	FOR(i, 1, sum / A) {
		ans += dp[N][A * i][i];
	}
	cout << ans << '\n';
}


