#include <bits/stdc++.h>
using namespace std;
const int N = 55;
const long long MOD = 1e9 + 7;
int main() {
  int n;
  int a;
  cin >> n >> a;
  int b[N][N * N] = {0};
  int p;
  long long cnt = 0;
  b[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> p;
    for (int j = i - 1; j >= 0; j--) {
      for (int k = 0; k <= N * j; k++) {
        b[j + 1][p + k] += b[j][k];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cnt += b[i][i * a];
  }
  cout << cnt << endl;
  return 0;
}
