// Original C++ solution (slower):
#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;

int x[55];



int y[55];

int X;

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



int main () {

  cin >> n >> a;

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



  X = max(*max_element(x,x+n),a);

  rep(i,n) y[i] = x[i] - a;



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

  rep(j,55) {

    rep(s,2555*2) {

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

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

      }

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

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

      }

    }

  }



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

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

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

#define rep(i,n) for (int i = (0); i < (n); ++i)

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

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

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

#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl;

#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl;

#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))

#define uni(x) x.erase(unique(rng(x)),x.end())

#define SP << " " <<

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 int mod = 1000000007;

const double EPS = 1e-9;

const int INF = 1<<30;

const ll INFLL = 1LL<<60;

//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 x[55];

ll y[55];

ll dp[55][5050];



int main () {

  ll n, a;

  cin >> n >> a;

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

  ll X = *max_element(x,x+n);

  rep(i,n) y[i] = x[i] - a;

  

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

  rep(i,n+1) {

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

      if (dp[i][j] == 0) continue;

      dp[i+1][j] += dp[i][j];

      dp[i+1][j+y[i]] += dp[i][j];

    }

  }



  ll ans = dp[n][n*X] - 1;

  cout << ans << endl;

  return 0;

}

// Fastest known solution for this problem: