#include <bits/stdc++.h>
using namespace std;
const int vx[4] = {0, 1, 0, -1};
const int vy[4] = {1, 0, -1, 0};
long long n, a;
long long x[100];
long long dp[1000][1000];
signed main() {
  cin >> n >> a;
  for (long long i = (long long)0; i < (long long)n; i++) {
    cin >> x[i + 1];
    x[i + 1] -= a;
  }
  dp[0][n * a] = 1;
  for (long long i = (long long)1; i < (long long)n + 1; i++) {
    for (long long j = (long long)0; j < (long long)2 * n * a + 1; j++) {
      if (j - x[i] < 0 || j - x[i] > 2 * n * a)
        dp[i][j] = dp[i - 1][j];
      else
        dp[i][j] = dp[i - 1][j] + dp[i - 1][j - x[i]];
    }
  }
  cout << dp[n][n * a] - 1 << endl;
}
