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

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

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

#define rep(i,n) FOR(i,0,(n))

#define REPS(i,n) FOR(i,1,(n)+1)

#define RREP(i,n) RFOR(i,0,(n))

#define ALL(x) (x).begin(),(x).end()

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

#define debug(x) cout << #x << " = " << (x) << endl;

#define SORT(x) sort(ALL(x));

#define RSORT(x) sort(RALL(x));

#define SUM(x) accumulate(ALL(x),0)

#define fi first

#define se second

#define pb push_back

#define eb emplace_back

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

#define bn(x) ((1<<x)-1)

#define dup(x,y) (((x)+(y)-1)/(y))

using namespace std;

using ll = long long;

using vi = vector<int>;

using vvi = vector<vi>;

using vll = vector<ll>;

using pii = pair<int, int>;

using tiii = tuple<int, int, int>;

const ll mod = 1e9+7;

const int INF = (1<<30)-1;

const ll INFLL = (1LL<<62)-1;

const int dx[4] = {1,0,-1,0};

const int dy[4] = {0,1,0,-1};

//cout << fixed << setprecision(10);



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

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



ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}

ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}



int n, a;

ll dp[55][55][2555] = {0};



int main () {

  cin >> n >> a;

  vi x(n);

  rep(i,n) cin >> x[i];



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

  rep(j,n+1) {

    rep(k,n+1) {

      rep(s,2555) {

        if (j >= 1 && s < x[j-1]) {

          dp[j][k][s] = dp[j-1][k][s];

        }

        if (j >= 1 && k >= 1 && s >= x[j-1]) {

          dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-x[j-1]];

        }

      }

    }

  }



  ll ans = 0;

  FOR(k,1,n+1) {

    ans += dp[n][k][k*a];

  }



  cout << ans << endl;

}


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

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

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

#define rep(i,n) FOR(i,0,(n))

#define REPS(i,n) FOR(i,1,(n)+1)

#define RREP(i,n) RFOR(i,0,(n))

#define ALL(x) (x).begin(),(x).end()

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

#define debug(x) cout << #x << " = " << (x) << endl;

#define SORT(x) sort(ALL(x));

#define RSORT(x) sort(RALL(x));

#define SUM(x) accumulate(ALL(x),0)

#define fi first

#define se second

#define pb push_back

#define eb emplace_back

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

#define bn(x) ((1<<x)-1)

#define dup(x,y) (((x)+(y)-1)/(y))

using namespace std;

using ll = long long;

using vi = vector<int>;

using vvi = vector<vi>;

using vll = vector<ll>;

using pii = pair<int, int>;

using tiii = tuple<int, int, int>;

const ll mod = 1e9+7;

const int INF = (1<<30)-1;

const ll INFLL = (1LL<<62)-1;

const int dx[4] = {1,0,-1,0};

const int dy[4] = {0,1,0,-1};

//cout << fixed << setprecision(10);



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

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



ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}

ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}



int n, a;

ll dp[55][5050] = {0};



int main () {

  cin >> n >> a;

  vi x(n);

  rep(i,n) cin >> x[i];



  int X = max(*max_element(ALL(x)),a);



  vi y(n);

  rep(i,n) {

    y[i] = x[i] - a;

  } 



  dp[0][n*X] = 1;

  rep(j,n+1) {

    rep(t,2*n*X+1) {

      if (j >= 1 && (t-y[j-1]<0 || t-y[j-1]>2*n*X)) {

        dp[j][t] = dp[j-1][t];

      }

      if (j >= 1 && (0<=t-y[j-1] && t-y[j-1]<=2*n*X)) {

        dp[j][t] = dp[j-1][t] + dp[j-1][t-y[j-1]];

      }

    }

  }



  cout << dp[n][n*X]-1 << endl;

}