#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, a;
  cin >> n >> a;
  ll x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    x[i] -= a;
  }
  ll count[6001];
  count[3000] = 1;
  fill(count, count + 6001, 0);
  for (ll i = 0; i < n; i++) {
    if (x[i] <= 0) {
      for (ll j = 0; j < 6001; j++) {
        if (j + x[i] >= 0 && j + x[i] <= 6000) {
          count[j + x[i]] = count[j + x[i]] + count[j];
        }
      }
    } else {
      for (ll j = 6000; j >= 0; j--) {
        if (j + x[i] >= 0 && j + x[i] <= 6000) {
          count[j + x[i]] = count[j + x[i]] + count[j];
        }
      }
    }
  }
  cout << count[3000] << endl;
}
