#include <bits/stdc++.h>
using namespace std;
const double pi =
    3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod = 1000000007;
int main() {
  int n, a, in[52] = {};
  cin >> n >> a;
  for (int i = (1); i <= (n); ++i) {
    cin >> in[i];
    in[i] -= a;
  }
  long long dp[55][55][150];
  for (int i = (0); i < (55); ++i)
    for (int j = (0); j < (55); ++j)
      for (int k = (0); k < (150); ++k) dp[i][j][k] = 0LL;
  dp[0][0][60] = 1LL;
  for (int i = (1); i <= (n); ++i) {
    for (int j = (0); j <= (i); ++j) {
      for (int k = (-55); k < (55); ++k) {
        dp[i][j][k + 60] += dp[i - 1][j][k + 60];
        if (j != 0) dp[i][j][k + 60] += dp[i - 1][j - 1][k + 60 - in[i]];
      }
    }
  }
  long long ans = 0LL;
  for (int j = (0); j <= (n); ++j) {
    ans += dp[n][j][60];
  }
  cout << ans - 1;
  return 0;
}
