#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  int table[51][2501];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2501; j++) {
      table[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    table[i][0]++;
    for (int j = 1; j < 2501; j++) {
      if (j - x[i] >= 0) table[i][j] += table[i - 1][j - x[i]];
      table[i][j] += table[i - 1][j];
    }
  }
  cout << table[n][a * n] << endl;
}
