#include <bits/stdc++.h>
using namespace std;
const int N = 55;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const double PI = acos(-1.0);
long long dp[N][N * N];
int main() {
  std::ios::sync_with_stdio(false);
  int n, a;
  cin >> n >> a;
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    for (int j = i - 1; j >= 0; j--)
      for (int w = 0; w <= N * j; w++) {
        dp[j + 1][w + x] += dp[j][w];
        cout << j + 1 << " " << w + x << " " << dp[j + 1][w + x] << endl;
      }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[i][i * a];
  }
  cout << ans << endl;
  return 0;
}
