#include <bits/stdc++.h>
using namespace std;
long long int n, m, cev, b, a[52], dp[53][25000][53];
string s;
vector<int> v;
long long int f(long long int sira, long long int topl, long long int kac) {
  long long int cevap = 0;
  if (sira > n && kac * m == topl) return 1;
  if (sira > n && kac * m != topl) return 0;
  if (~dp[sira][topl][kac]) return dp[sira][topl][kac];
  cevap += f(sira + 1, topl + a[sira], kac + 1);
  cevap += f(sira + 1, topl, kac);
  return dp[sira][topl][kac] = cevap;
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%lld %lld", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  printf("%lld", f(1, 0, 0) - 1);
  return 0;
}
