#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < n; ++i) x[i] -= a;
  vector<int> df(2501, 0);
  df[0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 2500; j - x[i] >= 0; --j) df[j] += df[j - x[i]];
  }
  ll ans = 0;
  for (int i = a; i <= 2500; i += a) {
    ans += df[i];
  }
  cout << ans << endl;
}
