#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, a;
int x[50];
ll accutable[50][2500][50];
ll dp(int i, int num, int cards) {
  ll ans = 0;
  if (accutable[i][num][cards] != 0) {
    return accutable[i][num][cards];
  }
  if (i == n) {
    if (cards == 0) {
      return 0;
    } else if (num == cards * a) {
      return 1;
    } else {
      return 0;
    }
  } else {
    ans = ans + dp(i + 1, num + x[i], cards + 1);
    ans = ans + dp(i + 1, num, cards);
    accutable[i][num][cards] = ans;
    return ans;
  }
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  ll ans = dp(0, 0, 0);
  cout << ans << endl;
}
