#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(const vector<T> &a) {
  for (T x : a) cout << x << " ";
  cout << endl;
}
vector<long long> xx = {1, 0, -1, 0};
vector<long long> yy = {0, 1, 0, -1};
string dir = "LRUD";
const long long N = 2e5 + 50, oo = 5e18 + 500;
const long long mod = 998244353;
const long double eps = 1e-6, PI = 2 * acos(0.0);
long long n, m, k;
long long cnt = 0;
long long lg = 18;
vector<long long> g[N];
vector<long long> rg[N];
vector<long long> visit(N, 0);
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
signed main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> m;
  vector<long long> x(n);
  long long B = 50 * 50;
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
    x[i] -= m;
    x[i] += 50;
  }
  vector<vector<long long> > dp(n, vector<long long>(2 * B + 1, 0));
  dp[0][x[0]] = 1;
  for (long long i = 1; i < n; i++) {
    dp[i][x[i]] = 1;
    for (long long j = 0; j <= 2 * B; j++) {
      if (dp[i - 1][j]) {
        dp[i][j] += dp[i - 1][j];
        if (j + x[i] <= 2 * B) dp[i][j + x[i]] += dp[i - 1][j];
      }
    }
  }
  for (long long i = 50; i <= 2 * B; i += 50) {
    cnt += dp[n - 1][i];
  }
  cout << cnt;
}
