#include <bits/stdc++.h>
using namespace std;
int dp[60][60][10000];
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  dp[0][0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int k = 0; k < n; ++k) {
      for (int s = 0; s <= n * 50; ++s) {
        if (s < x[i]) {
          dp[i + 1][k + 1][s] = dp[i][k + 1][s];
          if (k == 0) {
            dp[i + 1][k][s] = dp[i][k][s];
          }
        }
        if (s >= x[i]) {
          dp[i + 1][k + 1][s] = dp[i][k + 1][s] + dp[i][k][s - x[i]];
        }
      }
    }
  }
  long long res = 0;
  for (int k = 1; k <= n; ++k) {
    res += dp[n][k][k * a];
  }
  cout << res << endl;
}
