#include <bits/stdc++.h>
int dp[55][2505];
int main() {
  int n, a, i;
  long long ans;
  scanf("%d%d", &n, &a);
  dp[0][0] = 1;
  for (int c = 1; c <= n; c++) {
    scanf("%d", &i);
    for (int c2 = 54; c2 > 0; c2--)
      for (int c3 = 2504; c3 >= i; c3--) dp[c2][c3] += dp[c2 - 1][c3 - i];
  }
  ans = 0;
  for (int c = 1; c < 55; c++)
    if (c * a > 2500)
      break;
    else
      ans += dp[c][c * a];
  printf("%lld\n", ans);
}
