#include <bits/stdc++.h>
using namespace std;
int n, a;
int x[(1 << 7)];
long long dp[(1 << 7)][(1 << 7) << 2];
int main() {
  scanf("%d%d", &n, &a);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    x[i] -= a;
  }
  dp[0][x[0] + (1 << 7)] = 1LL;
  dp[0][(1 << 7)] += 1LL;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < ((1 << 7) << 2); j++) {
      dp[i][j] += dp[i - 1][j];
    }
    for (int j = 0; j < ((1 << 7) << 2); j++) {
      int jj = j + x[i];
      if (jj >= 0 && jj < ((1 << 7) << 2)) {
        dp[i][jj] += dp[i - 1][j];
      }
    }
  }
  printf("%lld\n", dp[n - 1][(1 << 7)] - 1LL);
  return 0;
}
