#include <bits/stdc++.h>
using namespace std;
long long s[2510][60][2];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, a;
  cin >> n >> a;
  s[0][0][0] = 1;
  s[0][0][1] = 1;
  long long ans = 0;
  int x;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    for (int j = 0; j <= 2500; ++j) {
      for (int k = 0; k <= i; ++k) {
        s[j + x][k + 1][1] += s[j][k][0];
      }
    }
    for (int j = 0; j <= 2500; ++j) {
      for (int k = 0; k <= n; ++k) {
        s[j][k][0] = s[j][k][1];
      }
    }
  }
  for (int k = 1; k <= n; ++k) {
    ans += s[a * k][k][1];
  }
  cout << ans;
  return 0;
}
