
#include <cstdio>
#include <iostream>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
typedef long long ll;

ll dp[60][2600];

int main(void) {
  int n;
  int avg;
  scanf("%d%d", &n, &avg);

  dp[0][0] = 1;
  REP(i, n) {
    int v;
    scanf("%d", &v);
    for(int j = i; j >= 0; --j) {
      for(int k = 2500; k >= 0; --k) {
        dp[j+1][k+v] += dp[j][k];
      }
    }
  }

  ll res = 0;
  for(int i = 1; i <= n; ++i) {
    res += dp[i][i*avg];
  }
  printf("%lld\n", res);
  
  return 0;
}
