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