#include <bits/stdc++.h>
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
using namespace std;
int main() {
  int n, a;
  vector<int> v;
  scanf("%d %d", &n, &a);
  for (int i = 0; i < n; ++i) {
    int t;
    scanf("%d", &t);
    v.push_back(t);
  }
  vector<vector<vector<int>>> dp(
      n + 1, vector<vector<int>>(n + 1, vector<int>(n * a + 10, 0)));
  printf("%d\n", v[0]);
  dp[0][0][0] = 1;
  for (int i = 0; i < n + 1; ++i) {
    for (int j = 0; j < n + 1; ++j) {
      for (int k = 0; k < a * n + 1; ++k) {
        if (j == 0 && k == 0)
          dp[i][j][k] = 1;
        else if (i > 0 && k - v[i - 1] >= 0 && j > 0) {
          dp[i][j][k] += dp[i - 1][j - 1][k - v[i - 1]] + dp[i - 1][j][k];
        } else if (i > 0)
          dp[i][j][k] += dp[i - 1][j][k];
        else
          dp[i][j][k] = 0;
      }
    }
  }
  long long res = 0;
  for (int i = 1; i < n + 1; ++i) {
    res += dp[n][i][i * a];
  }
  printf("%lld\n", res);
  return 0;
}
