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

#include <vector>

#include <cmath>

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

#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)

#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)

#define REPx(x, a) for(auto x : a)

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

#define SORT(a) sort(ALL(a))

#define SORTG(a) sort(ALL(a), greater<int>())

#define REVERSE(a) reverse(ALL(a))

#define bit_search(bit, n) REP(bit, 1<<(n))

#define bit_check(bit, i) (bit>>(i)) & 1

#define setpre(n) fixed << setprecision((n))

#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)

#define MAX(a) *max_element(ALL(a))

#define MIN(a) *min_element(ALL(a))

#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()

#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()

#define ENDL cout << endl;

using namespace std;

using ll = long long;

using ld = long double;

using PII = pair<int, int>;

using VPII = vector<PII>;

using VI = vector<int>;

using VVI = vector<VI>;

using Vll = vector<ll>;

using VVll = vector<Vll>;

using VC = vector<char>;

using VS = vector<string>;

using VB = vector<bool>;

const int INF = 1e9;

const ll MOD = 1e9 + 7;



const ll rem = 200;



int main()

{

  cin.tie(0);

  ios::sync_with_stdio(false);

  ll N, A;

  cin >> N >> A;

  Vll x(N+1);

  REP2(i, 1, N+1)

  {

    cin >> x[i];

    x[i] -= A;

  }

  vector<VVll> dp(N+1, VVll(N+1, Vll(2*rem, 0)));

  REP2(i, 1, N+1)

  {

    ll idx_k;

    if (x[i] >= 0) idx_k = x[i];

    else idx_k = rem - x[i] - 1;

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

  }



  REP2(i, 1, N+1) REP2(j, 1, N+1)

  {

    if (j > i) break;

    REP(k, 2*rem)

    {

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

      ll kk;

      if (k >= rem) kk = rem - k - 1;

      else kk = k;

      if (kk-x[i] < -rem || kk-x[i] >= rem) continue;

      if (kk-x[i] >= 0) dp[i][j][k] += dp[i-1][j-1][kk-x[i]];

      else dp[i][j][k] += dp[i-1][j-1][rem - kk + x[i] - 1];

    }

  }

  ll ans = 0;

  REP2(j, 1, N+1) ans += dp[N][j][0];

  cout << ans << endl;



  return 0;

}

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

#include <vector>

#include <cmath>

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

#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)

#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)

#define REPx(x, a) for(auto x : a)

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

#define SORT(a) sort(ALL(a))

#define SORTG(a) sort(ALL(a), greater<int>())

#define REVERSE(a) reverse(ALL(a))

#define bit_search(bit, n) REP(bit, 1<<(n))

#define bit_check(bit, i) (bit>>(i)) & 1

#define setpre(n) fixed << setprecision((n))

#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)

#define MAX(a) *max_element(ALL(a))

#define MIN(a) *min_element(ALL(a))

#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()

#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()

#define ENDL cout << endl;

using namespace std;

using ll = long long;

using ld = long double;

using PII = pair<int, int>;

using VPII = vector<PII>;

using VI = vector<int>;

using VVI = vector<VI>;

using Vll = vector<ll>;

using VVll = vector<Vll>;

using VC = vector<char>;

using VS = vector<string>;

using VB = vector<bool>;

const int INF = 1e9;

const ll MOD = 1e9 + 7;



const ll rem = 200;



int main()

{

  cin.tie(0);

  ios::sync_with_stdio(false);

  ll N, A;

  cin >> N >> A;

  Vll x(N+1);

  ll X = A;

  REP2(i, 1, N+1)

  {

    cin >> x[i];

    X = max(X, x[i]);

    x[i] -= A;

  }

  VVll dp(N+1, Vll(2*N*X+1, 0));

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

  REP2(j, 1, N+1) REP(t, 2*N*X+1)

  {

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

    if (t - x[j] < 0 || t - x[j] > 2*N*X) continue;

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

  }

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



  return 0;

}