#include <bits/stdc++.h>
using namespace std;
const int N = (int)(51);
const int LOG = (int)(20);
long long int n, m, ar[N], dp[N][N][N * N];
long long int f(int x, int y, int sm) {
  if (dp[x][y][sm] != -1) return dp[x][y][sm];
  if (x == n + 1) {
    if (y == 0) return 0;
    if (sm % y == 0 && sm / y == m) return 1;
    return 0;
  }
  return dp[x][y][sm] = f(x + 1, y + 1, sm + ar[x]) + f(x + 1, y, sm);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  freopen("inp.in", "r", stdin);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> ar[i];
  memset(dp, -1, sizeof dp);
  cout << f(1, 0, 0);
}
