#include <bits/stdc++.h>
int main() {
  int n, a;
  scanf("%d %d", &n, &a);
  int v[n];
  for (int i = 0; i < n; ++i) scanf("%d", &v[i]);
  long dp[n + 1][n + 1][50 * n + 1];
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= n; ++j)
      for (int k = 0; k <= 50 * n; ++k) dp[i][j][k] = 0;
  dp[0][0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= i; ++j) {
      for (int k = 0; k <= 50 * i; ++k) {
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i][j + 1][k + v[i]] += dp[i][j][k];
      }
    }
  }
  long ans = 0;
  for (int i = 0; i <= n; ++i) ans += dp[n][i][a * i];
  printf("%ld\n", ans);
}
