#include <bits/stdc++.h>
using namespace std;
const int N = 2500;
long long dp[50][5005];
int n, m, x, y;
int main() {
  cin >> n >> m;
  dp[0][2500] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    y = x - m;
    for (int j = 0; j <= 5000; j++) {
      dp[i][j] += dp[i - 1][j];
      if (j + y < 0 || j + y > 5000) continue;
      dp[i][j + y] += dp[i - 1][j];
    }
  }
  cout << dp[n][2500] - 1 << endl;
  return 0;
}
