#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  int x[101];
  int dp[101][2501] = {};
  long long int ans = 0;
  dp[0][0] = 1;
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 2500; j++) {
      if (j < x[i]) {
        dp[i + 1][j] += dp[i][j];
      } else {
        dp[i + 1][j] += dp[i][j];
        dp[i + 1][j] += dp[i][j - x[i]];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    ans += dp[n][a * i];
  }
  cout << ans << endl;
}
