#include <bits/stdc++.h>
using namespace std;
int dp[51][51][2501];
int a[51];
int n, m;
int func(int here, int how, int gap) {
  if (here == n) {
    if (how == 0)
      return 0;
    else if (gap % how == 0 && gap / how == m)
      return 1;
    else
      return 0;
  }
  int &ret = dp[here][how][gap];
  if (ret != -1) return ret;
  ret = 0;
  ret += func(here + 1, how + 1, gap + a[here]);
  ret += func(here + 1, how, gap);
  return ret;
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  printf("%d", func(0, 0, 0));
}
