#include <bits/stdc++.h>
using namespace std;
long long dp[5001];
int main() {
  int N, A;
  scanf("%d%d", &N, &A);
  dp[2500] = 1;
  for (int i = int(0); i < int(N); ++i) {
    int x;
    scanf("%d", &x);
    x -= A;
    for (int s = int(0); s < int(5000); ++s)
      if (dp[s]) {
        dp[s + x] += dp[s];
      }
  }
  long long ans = dp[2500] - 1;
  (void)printf("%lld\n", ans);
  return 0;
}
